Running the script
The very last step in the script process is invoking the Windows server scanning script. You will need to ensure that you have the answer
file in the same directory as the script. You will also want to make sure that you keep a copy of the answer
file, because the Windows server scanning script will remove the answer
file after execution.
To execute the Windows server scanning script from a command line, you can perform the following:
powershell.exe -executionPolicy bypass -noexit -file"c:\temp\ScanningScript.ps1" "AAZwAmAE4AMgAoAFEAVAAhAFAA"
The output of this is shown in the following screenshot:
In this example, you successfully launch the Windows server scanning script:
- You first start by calling the
powershell.exe
executable from an elevated command prompt. - You bypass the PowerShell execution policy by leveraging the
-executionPolicy
parameter with thebypass
argument. - You then leverage the
-noexit
parameter to ensure that the PowerShell session doesn...