Gerenios / AADInternals

AADInternals PowerShell module for administering Azure AD and Office 365
http://aadinternals.com/aadinternals
MIT License
1.27k stars 216 forks source link

cspparameter: Key not valid for use in specified state #23

Closed Lynalin9999 closed 2 years ago

Lynalin9999 commented 2 years ago

I met an issue when remote executing: Join-AADIntDeviceToAzureAD -DeviceName "test" -DeviceType "Commodore" -OSVersion "Vic20" -JoinType Join for some purpose, I need to setup my win10 computer to leave domain and then join AAD. leave domain: Invoke-Command -ComputerName $clientIp -Credential $domainCred -ScriptBlock { param($domainCred) Add-Computer -WorkgroupName test -Credential $domainCred -Restart -Force } -ArgumentList $domainCred After leave domain, I always failed to join AAD, then I found that private key is not generated in the pfx file. image Problem code is this line: $cspParameters.KeyContainerName ="AADInternals" Looking forward to any workaround for this issue. Thanks a lot

NestoriSyynimaa commented 2 years ago

In general, that error means that you do not have permission to access the private key. Could explain in more detail (step by step) when you get the error?

Lynalin9999 commented 2 years ago

此QQ用户不接受陌生人的邮件