error running (Get-WindowsAutopilotInfo.ps1)

Rabii BENABDALLAH 26 Reputation points
2022-06-29T14:48:39.023+00:00

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

  • $serial = (Get-CimInstance -CimSession $session -Class Win32_ ...
  • ~~~~~~~~~~~~~~~~~~~
    +CategoryInfo : InvalidData : ( : ) [Get-CimInstance], ParameterBindingValidationException
    +FullyQualifiedErrorID : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Management.Infrastructure.CimCmDlets.GetCimInstanceCommand

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

Microsoft Security | Windows Autopilot
0 comments No comments
{count} vote

Accepted answer
  1. Pavel yannara Mirochnitchenko 13,341 Reputation points MVP
    2022-07-04T11:20:56.24+00:00

    I believe you have an error in your line:

    install -script Get-WindowsAutopilotInfo.ps1 -3 -online

    If fails because -3 you put there.

    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Rabii BENABDALLAH 26 Reputation points
    2022-07-05T11:17:18.063+00:00

    @Pavel yannara Mirochnitchenko
    Thank you for your answer. That's what i thin too but i am unable to figure out how to fix this.
    If i want to add a group tag to a device using PowerShell how am i supposed to do ( if you have any idea)


  2. Mohammed Ali 0 Reputation points
    2024-07-24T06:59:57.6466667+00:00

    For me after updating the bios drivers , i was able to get the device hash.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.