UPN TenantId
--- --------
admin@x.onmicrosoft.com be398df7-
Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Get-MobileAppsBeta.ps1:18 Zeichen:9
+ $errorResponse = $ex.Response.GetResponseStream()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Get-IntuneAppProtectionPolicy : 400 Bad Request
{
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"date": "2021-02-17T23:13:43",
"request-id": "128e1a31-43e3-4a0f-8c04
"client-request-id": "128e1a31-43e3-4a0f
}
}
}
In C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Functions\Invoke-IntuneDocumentation.ps1:153 Zeichen:13
+ $MAMs = Get-IntuneAppProtectionPolicy | Where-Object { $_.'@odata ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Verbindungsfehler: (@{Request=; Response=}:PSObject) [Get-DeviceAppMa...agedAppPolicies], HttpRequestException
+ FullyQualifiedErrorId : PowerShellGraphSDK_HttpRequestError,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Get_DeviceAppManagement_ManagedAppPolic
ies
Get-IntuneAppProtectionPolicy : 400 Bad Request
{
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"date": "2021-02-17T23:13:43",
"request-id": "2d59d983-ef55-
"client-request-id": "2d59d983
}
}
}
Then I tried Invoke-ConditionalAccessDocumentation - this worked and I got a Word-File with content.
########################################################
PS C:\temp> Invoke-ConditionalAccessDocumentation -FullDocumentationPath c:\temp\CADoc.docx
Cmdlet Invoke-ConditionalAccessDocumentation an der Befehlspipelineposition 1
Geben Sie Werte für die folgenden Parameter an:
ClientId: 31ddbfbd-563f-
ClientSecret: zbvSsjZc
Tenant: be398df7-a2a8
#########################################################
Then I tried the other command with the same credetial details. This does NOT work.
PS C:\temp> Invoke-IntuneDocumentation -FullDocumentationPath c:\temp\IntuneDoc2.docx -ClientId 31ddbfbd-563f -ClientSecret zbvSsjZcvr -Tenant be398df7-a2a8
Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
In C:\Program Files\WindowsPowerShell\Modules\IntuneDocumentation\2.0.19\Internal\Get-MobileAppsBeta.ps1:18 Zeichen:9
+ $errorResponse = $ex.Response.GetResponseStream()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Get-IntuneAppProtectionPolicy : 400 Bad Request
{
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"date": "2021-02-17T23:20:53",
"request-id": "c644bc4c-
"client-request-id": "c644bc4c-
}
}
}
I found the issue by myself. My permissions where screwed up. After deleting the old account and login with a newly created global admin account everything worked without any problem.
Does not work. All ID's are redacted for security reason. I am the Global Admin of that tenant.
Here I am asked for Admin consent and granted it
Then I tried Invoke-ConditionalAccessDocumentation - this worked and I got a Word-File with content.
Then I tried the other command with the same credetial details. This does NOT work.
My environment