CJSmith dot me

I dump stuff I find useful here

Category: Windows Server 2008

Remotely remove a broken user profile from another computers registry when the user folder is deleted

Published / by Chris Smith / Leave a Comment

I recently had an issue where someone had deleted my admin user profile from a remote server by deleting its folder.
The logon then failed as Windows still expected the folder to be there, as obviously the registry entries were not removed.
Rather than manually checking HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList for the SID and then removing it WMIC can be used. A user called Tommylotmanagement posted an answer and I found it worked if the user folder profile has been deleted as well.

It should then show:
Deleting instance \\<Server>\root\cimv2:Win32_UserProfile.SID=”<SID>”
Instance deletion successful

If it fails check the file c:\windows\temp\wmic.err in a text editor.

Credit: Tommylotmanagement

I have also found this has worked to correct issues where accounts keep generating TEMP or TEMP. folders.

Display advanced properties of scheduled tasks in command line

Published / by Chris Smith / Leave a Comment

The following command requests a detailed display of the tasks on the local computer. It uses the /v parameter to request a detailed (verbose) display and the /fo LIST parameter to format the display as a list for easy reading. You can use this command to verify that a task you created has the intended recurrence pattern.
Before running increase the command prompts screen buffer (Right click the Window, go to properties, go to Layout and set the Screen Buffer Height to 9999). If this is not done you will find due to the amount of Windows scheduled tasks, that the tasks you want are cleared from thje screen buffer.

SchTasks.exe displays a detailed property list for all tasks. I normally will then copy everything into the clipboard (Ctrl + A) and pout it into a text editor, I then delete anything after “Folder: \Microsoft” so I then only have my list of scheduled tasks.

Credit: Technet

Filtering in Event Viewer Windows Server 2008 onwards

Published / by Chris Smith / Leave a Comment

The Event Viewer from Server 2008 onwards is XML based.
Filters based on XML syntax can be used such as:

You can search for anything which appears in the data section such as service names, error messages etc..

MS Technet