Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

removing local profiles remotely

$
0
0

When imaging computers we usually create a profile temp before joining the domain. These should be deleted but many times this is overlooked. what i need is a line of script that looks at the remote computers and outputs a list of profiles on them. I do not need the SID etc

 get-wmiobject win32_userprofile

provides to much, i am getting an error using -filter and any version of local path, i want to output just the computers that have a profile C:\user\temp

The next problem i have is removing the profile. If i log into a computer and look at users and groups i see the user 'Temp' but there is no folder and can not therefore delete it. Seems a lot to do each manually. Also this is a security loophole as the profile has local admin rights. 

Any help would be appreciated.

I have used delprof2 successfully where it sees the profile, but sometimes it says their is no such profile when there most certainly is.Confused


Viewing all articles
Browse latest Browse all 6937

Trending Articles