gerheart.blogg.se

Windows server 2012 remote desktop full computer name
Windows server 2012 remote desktop full computer name













$ErrorLogFile = "$env:USERPROFILE\Desktop\Get-UsersAndLogOffComputers.If you would like to read the first article in this series please go to Using PowerShell to control RDS in Windows Server 2012. Great, so now that have the parameters and the examples out of the way, let’s get to the actual script. Script To Get Users Logged Into Windows Server Remotely The “Doesntexist” computer was not found and obviously not online so the error that was logged was “The RPC server is unavailable.” The default path for the error log file is going to be the users desktop. The username DJones doesn’t have rights to the server so the error that was logged shows Access is denied. In this example I specified the computer names PAC-FS01 and DoesntExist. PS C:\> Get-UsersAndLogOffComputers -ComputerName PAC-FS01, DoesntExist -Username DJones -LogErrors The same output will occur with the -Logoff Switch, however it will log the specified user off as long as it has admin rights to that machine.Įxample 5: Log the errors (if any) to give you a better idea of what the issue is. PS C:\> Get-UsersAndLogOffComputers -ComputerName PAC-FS01 -Username DJones -Logoff PAC-SCCM01 didn’t find a match so nothing was outputted.Įxample 4: Specify the username DJones and log it off the computer named PAC-FS01. The username DJones was specified and it was found logged into PAC-FS01. PS C:\> Get-UsersAndLogOffComputers -ComputerName PAC-FS01, PAC-SCCM01 -Username DJones The Idle session means someone RDP’d in and disconnected instead of logging off.Įxample 3: Specify multiple computernames and a username. As you can see PAC-FS01 has an active session and PAC-SCCM01 has an Idle session. PAC-FS01 and PAC-SCCM01 were both specified and results were outputted.

windows server 2012 remote desktop full computer name

PS C:\> Get-UsersAndLogOffComputers -ComputerName PAC-FS01, PAC-SCCM01

windows server 2012 remote desktop full computer name

Example 1: The default option is to check the current user and current computer.Įxample 2: Specify a computername or multiple computernames seperated by a comma.















Windows server 2012 remote desktop full computer name