lookiresources.blogg.se

Silent start ps script
Silent start ps script







Downloading Sysinternals and Starting the script as system Start-Process -FilePath "c:\ProgramData\CustomScripts\pstools\psexec.exe" -windowstyle hidden -ArgumentList '-i -s cmd /c "powershell.exe -ExecutionPolicy Bypass -file 3. Send-MailMessage -From $EmailFrom -To $EmailTo -Subject $EmailSubject -SmtpServer $SMTPServer -Attachments c:\ProgramData\CustomScripts\mycomputer.csv Upload-WindowsAutopilotDeviceInfo -TenantName $tenantname -OrderIdentifier "AADUserDriven" -VerboseĬ:\ProgramData\CustomScripts\Get-WindowsAutoPilotInfo.ps1 -OutputFile c:\ProgramData\CustomScripts\M圜omputer.csv Save-Script -Name Get-WindowsAutoPilotInfo -Path c:\ProgramData\CustomScripts -force | out-null Install-packageprovider -name nuget -minimumversion 2.8.5.201 -force | out-null New-Item -Path c:\programdata\customscripts -ItemType Directory -Force -Confirm:$false | out-null $ErrorActionPreference= 'silentlycontinue' $session.InvokeMethod($namespaceName, $instance, $methodName, 2. $instance = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter “ParentID=’./Vendor/MSFT’ and InstanceID=’RemoteWipe'” Reset Device WMI PART #MDM WMI Bridge part And you can also create a nice “GUI” instead of the script… :), to make it look better. You can also create a Flow to automate the autopilot part instead. It’s not the nicest script… but it gets the job done. Runs the first script as admin (UAC prompt) and after the first script, it runs the second script (Reset Device) as system. It just simply starts the script… creates 2 scripts. Downloading Sysinternal Tools and extracting it.Autopilot export and Email (or auto-upload) part.So to automate it and make it somehow easier for the customer, I created a Powershell Script to do the same with only 1 UAC prompt.

silent start ps script

Also, I wanted to export the autopilot info at the same time without prompting for a username and password.

silent start ps script

It works great… But starting Powershell as an admin and elevating the PowerShell session to the system account, was time taking. Some time ago I tested the possibility to reset your device with the MDM Bridge WMI Provider. Of course, when you want to wipe or reset an existing, not Intune MDM enrolled device you can run: Systemreset.exe or do a reset manually. I will divide this blog into multiple parts

#Silent start ps script how to

This blog will be how to wipe/reset your Windows 10 Device, the scripted way when you are (not yet) using Intune.







Silent start ps script