I just ran into a case where I needed to remove the PC side client from BMC TrackIt! from an entire domain. I created a little script to do it for me. It happily ran through and removed it from every workstation. It's quick and dirty but it does work. clear-host function Run-RemoteCMD { param ( [Parameter(Mandatory = $true ,valuefrompipeline = $true )] [ string ] $computer , [ string ] $command ) begin { #$computer #$command = "ipconfig /registerdns" #Read-Host " Enter command to run" [ string ] $cmd = "CMD.EXE /C " + $command } process { ...
Posts
Showing posts from April, 2014
How to use PowerShell to find what computer a user is CURRENTLY logged into.
- Get link
- X
- Other Apps
I recently had an issue where I needed the ability to identify the PC(s) where a user was logged into. I found part of the answer here: http://deployhappiness.com/find-out-what-computer-a-user-logged-into/#comment-5068 I won't reprint it here but the jist is by using a logon/logoff VB script, and a GPO, you can populate a field in the Active Directory record of each PC in a domain. That part works really well. After that you would need to search AD for the username to identify the PC. What I've done is created a PowerShell script with a GUI to do it for you. Now, it's not finished yet, but it does work. The code below is dirty and as soon as I get it the way I want I'll update this posting, but for now, it works pretty well. Don't complain about bugs,I know it has them, I'm working on it. And, yes, I have no doubt some things could be done better or more efficiently, feel free to post improvements. What it has (or will have): Self re...