Azure – PowerShell – Device User and Owner ObjectId
Return the User objectId and Device objectId to be able to make changes to the device record in Azure.
Lab Core | The Lab of MrNetTek
A blog about IT, technical solutions, and code.
Return the User objectId and Device objectId to be able to make changes to the device record in Azure.
Screenshots & Flow Show Toast 1 Run script.cmd (generated by PowerShell) Show Toast 2 Code Notes Balloon Tip – Toast (older post demonstrating clickable events) Disable Quiet Hours Key: HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\QuietHours Type: DWORD Value: Enable Data: 0 Enable Notifications Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications Type: DWORD Value: ToastEnabled Data: 1 Key: HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer Type: Read More …
Template Example Production Example
Template Example Production Example
Run on an AD network to return machines that have logged in X amount of times.
Testing what the process looks like… To turn this into a production ready process: Step 1 Create the batch file c:\YourScript\script.cmd Step 2 Create the scheduled task Step 3 Restart computer Step 4 Verify the script ran and the task was deleted Notes Something that is pretty cool, this process survives sysprep Read More …
For those in the know, remove this software… Notes Return all MS Apps Get-AppxPackage -AllUsers Remove Apps that Match String Get-AppxPackage *xboxapp* | Remove-AppxPackage Remove Specific App Remove-AppxPackage -AllUsers -Package “AD2F1837.HPJumpStarts_1.5.1296.0_x64__v10z8vjag6ke6” From the Command Line powershell.exe -command “Remove-AppxPackage -AllUsers -Package AD2F1837.HPJumpStarts_1.5.1296.0_x64__v10z8vjag6ke6” HP App Details Other Apps 7EE7776C.LinkedInforWindows_2.0.1.0_neutral__w1wdnht996qgy Microsoft.XboxSpeechToTextOverlay_1.21.13002.0_x64__8wekyb3d8bbwe Read More …
Use WMI in PowerShell to control log off and shutdown. Useful for when logoff.exe or shutdown.exe will not work (as in virtual sessions). 0 – Logoff 1 – Shutdown 2 – Reboot 4 – Forced logoff 5 – Forced shutdown 6 – Forced reboot 8 – Power off 12 – Forced power off Read More …
PING a computer and show active results in a GUI Window (not as easy as it sounds). Get user input Show results Code Notes Download the Powershell Icon