Remotely Log Users Off From CLI / PowerShell
Feb15

Remotely Log Users Off From CLI / PowerShell

KB ID 0001401 Problem I’ve not had to do this since the days we got “The terminal server has exceeded the maximum number of allowed connections” errors. Now thankfully Windows Server tells us who is logged on so we can ‘ask politely’ before we boot them off! Today though, my user session got all messed up, and I needed to kick ‘myself’ off remotely, (and have a fresh session.) Solution From a...

Read More
PowerShell: Creating Domains and Domain Controllers
Feb12

PowerShell: Creating Domains and Domain Controllers

KB ID 0001400 Problem I needed to spin up some Windows 2016 Servers, and a domain to do some testing. I have promoted hundreds maybe thousands of domain controllers, so I wondered if this time I could do it with PowerShell. It’s actually easier than using the GUI! Solution If you were doing this in Server Manager, you would have to add the role first, and PowerShell is no different; Install-WindowsFeature AD-Domain-Services...

Read More
PowerShell: Prompt Has Changed To Two Greater Than Signs
Dec23

PowerShell: Prompt Has Changed To Two Greater Than Signs

KB ID 0001380 Problem What does this mean? Well it means you’ve either got something wrong, or missed something out, and PowerShell is not sat waiting for more input. Which is fine but in most cases you simply need to fix your syntax and sort again so how do you ‘escape’ back to the normal PowerShell prompt? Solution As you can see, (below) typing quit or exist does not help. You need to press CTRL+C. Related...

Read More
PowerShell: Restart Fails ‘Other Users Logged On’
Dec03

PowerShell: Restart Fails ‘Other Users Logged On’

KB ID 0001374 Problem If you intend to shutdown, or restart a remote computer using PowerShell, you may see the following error message; PS C:\> Restart-Computer “Computer-name“ Restart-Computer : This command cannot be run on target computer(‘Computer-name’) due to following error: The system shutdown cannot be initiated because there are other users logged on to the computer. At line:1 char:1 + REstart-Computer...

Read More
Unable to Find a Default Server With Active Directory Web Services Running
Jan15

Unable to Find a Default Server With Active Directory Web Services Running

KB ID 0001275 Dtd 14/01/17 Problem I was trying to get a list of all users on a client’s domain that had either a logon script, profile, or a mapped drive that was being set on their AD user object. But when I ran the command I got this error; Get-ADUser : Unable to find a default server with Active Directory Web Services running. Solution Active Directory Web services was introduced in Server 2008 R2, but I was running the...

Read More
Move AD Group Members to an OU
Dec23

Move AD Group Members to an OU

KB ID 0001266 Dtd 23/12/16 Problem I got asked to do this at work this week, PLEASE BE AWARE, moving users about within AD may drastically change the way your ‘User Group Policies’ are being applied. So do some Group Policy Modelling beforehand, to avoid any problems. Solution In the example above, I’ve got ten users in a security group called ‘Source-Group‘. For simplicity, they are all in the same...

Read More