Remote access to the Plug and Play (PNP) RPC interface was removed in Windows 8, and since that time administrators have been unable to remotely manage Windows devices without RDP or a third party utility. I haven’t been a desktop support person in years, and only recently learned about this, when troubleshooting a workstation with…
Tag: WMI
Logoff User, Shutdown or Reboot Computer
Send-LogoffShutdown_ps1 is an interactive script with the following menu options: Logoff, Force Logoff (NO SAVE), Powerdown, Force Powerdown (NO SAVE), Reboot, Force Reboot (NO SAVE), Ping test, Check for logged on user(s), and Send User(s) Message. Most of the work is done using WMI.
Remotely Execute GPRESULT, and Collect Results
A common program for troubleshooting group policies is gpresult. Get-GPResult_ps1. This interactive script uses WMI to allow the administrator to target an existing user on the remote computer, and then to run either gpresult /h or gpresult /v. The results are written to a temporary file on the remote machine, then displayed when the data…
Test Disk Status
My home media server lost a hard drive earlier this year. I had no idea how long it had been in service, or that it was about to go, despite this data being available from WMI. Test-DiskStatus.ps1 will give you the following information for each drive on the system queried: drive letter, size in GB,…
PowerShell and Process Owners
If you are running as an administrator, it is easy to get the owner associated with a process using PowerShell: Get-Process -IncludeUserName. Get-Process gets information from System.Diagnostics.Process, not WMI. But you can get similar information from WMI, even if you aren’t an administrator. We had a little debate about this in our last Charlotte PowerShell…
Get WMI Namespaces with PowerShell
Here is a quick way to get a list of WMI namespaces on a computer using PowerShell. Notice that this requires that you run it as an administrator. #Requires -RunAsAdministrator Function Get-WMINamespaceEnum ($NS) { Write-Output $ns Get-CimInstance “__Namespace” -Namespace $NS -ErrorAction SilentlyContinue | ForEach-Object { Get-WMINamespaceEnum “$ns\$($_.name)” } } #Example Get-WMINamespaceEnum ‘root’ | Sort-Object The…
Two Ways to Get Mapped Drives with WMI
For years I have been getting mapped drives from WMI using Win32_NetworkConnection. Typical code looks like this in PowerShell: Get-CimInstance -ClassName ‘Win32_NetworkConnection’ | Select LocalName, RemotePath I have been using a product called ExpanDrive to map my cloud storage to drive letters. When I tried to view the drives with Win32_NetworkConnection, I had no results….
Delete User Profiles Interactively with PowerShell
Last week, one of my administrators was complaining at how involved it was to remove a profile on a remote user’s computer. A little over two years ago, I wrote Delete Inactive Profiles, as a substitute for DelProf for post Windows XP OS. That script is an advanced function, and was designed to remove stale…
Finding Rarely Used Computers On Your Network
I support a number of hospitals. Many of these have very large facilities, where the placement of computers was originally done by a space planner or others trying to make an educated guess about how and where people would be working. Frequently we find that there are computers which are unused or only rarely used. …
Win32_ReliablityRecords, PowerShell and ScriptoMatic
I was reviewing my blog stats today and found a link from a site in UK to my version of ScriptoMatic.hta. I have upgraded my home laptop to 8.1, and decided to see whether it still works (it does). If you launch the “fixed” ScriptoMatic as an ordinary user, it takes a very long time…