Category: Powershell

How to find a logged-in user with Powershell remotely

  Sometimes I need to see what users are logged-in to a device. Mainly before rebooting it from remotely. I’m doing this trough the following command that is using the WMI instance Win32_ComputerSystem Just change CLIENT1 Get-WmiObject –ComputerName CLIENT1 –Class Win32_ComputerSystem | Select-Object UserName

How to Extract certain driver from windows

If you can not find the driver but it is installed on another machine this trick will help. It only works for 3rd party drivers Create a Folder on the machine to hold all the drivers. In my example I will use c:\temp Next we need to find the INF name of the installed driver. Go to Computer Manager -> Device Manager – Right click on a driver then properties Click on Tab details. Select […]

Howto: Shutdown remote computer with powershell

Today I was to lazy to walk to my pc and turn it off. I had my laptop next to me and normally I use remote desktop to connect to the pc and open a command line and shutdown /s Today I thought to use powershell. I need to use it more any way.. To setup a connection and put in commands on the remote pc. Use the following command Enter-PSSession -Computername <name of pc> […]

70-410 Powershell Cheat Sheet

Currently I’m studying for the 70-410 Exam. I’m currently creating a sheet for the PowerShell commands I encounter during the study. This list will grow during my study. Any tips, hint or comments will be welcome. Start List Cmdlet Description Add-ADCentralAccessPolicyMember Adds central access rules to a central access policy in Active Directory Add-ADgroupmember PhoenixAdmins PhoenixAdmin01, PhoenixAdmin02 Add members to group Add-ADResourcePropertyListMember Adds one or more resource properties to a resource property list in Active […]