I believe you have an error in your line:
install -script Get-WindowsAutopilotInfo.ps1 -3 -online
If fails because -3 you put there.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello i am trying to import a device into intune using the script on Microsoft Gallery but i am getting the error below :
+CategoryInfo : Not Enabled : (:) [New-CimSession], CimException
+FullyQualifiedErrorID :HRESULT 0X803380e4, Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand
+PSComputerName : -3
Get-CimInstance : Impossible de lier l'argument au paramètre « CimSession», car il a la valeur Null.
Au caractère C:\Program Files\WindowsPowershell\Scripts\Get-WindowsAutoPilotInfo.ps1:208 :42
I got the window to sign in and used my admin account to do it and then got the error message .
Could you help please
I believe you have an error in your line:
install -script Get-WindowsAutopilotInfo.ps1 -3 -online
If fails because -3 you put there.
@Rabii BENABDALLAH Thanks for posting in our Q&A.
Honestly, I'm not familiar with the error message in PowerShell. However, I can share some information about how I get it.
I usually run Windows PowerShell ISE as administrator and run the following commands. Then I will get the csv file(in c:\device) about the device information.
New-Item -Type Directory -Path "C:\device"
Set-Location -Path "C:\device"
$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Install-Script -Name Get-WindowsAutopilotInfo
Get-WindowsAutopilotInfo -OutputFile AutopilotHWID.csv
Hope it will help.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@Lu Dai-MSFT
Hey , thank you for your answer.
the script you mentionned works fine but we need to add a tag to the device so that it is moved to a dynamic group.
the command am using is install -script Get-WindowsAutopilotInfo.ps1 -3 -online and just after entering my credentials i got the error msg.
This is due to the 2022-05 updates breaking things :)
after install KB5013942 - 2022-05 Cumulative Update for Windows 10 Version 21H2 this issue started occurring... not sure if the june update fixes it but.. uninstalling that update will also fix it
@Rudy Ooms thank you for your answer. Indeed i checked that update and it is not installed on the device.