Sunday, August 31, 2014

How to remove unnecessary users and groups from the local Administrators group, with a VBS script.

There are times when you want to restrict access to your computer at work. Disposable cleaning group will not help, because in the future membership of a group can change the domain group policy. Therefore, it may help a scheduled task, the task can be performed every 5 minutes. With "net localgroup" I was not able to remove the group from the group, so I propose to use the following VBS script to remove users and groups from the local Administrators group:

Download clear_adm.vbs

Set objGroup = GetObject("WinNT://./Administrators,group")

For Each Member in objGroup.members
 if not ((Member.name = "Administrator") or (Member.name = "myAccount1") or (Member.name = "myAccount2") or (Member.name = "myAccount3")) then objGroup.Remove(Member.ADSPath)
Next

Tuesday, August 26, 2014

Quick release system disk windows 2008 by "System queued Windows Error Reporting" and "Service Pack Backup Files"

In Windows 2008 quickly running out of space on the system drive. Servers Windows 2003 was a wonderful tool Disk Cleanup, but unfortunately in Windows 2008, you must additionally install this utility as components Desktop Experience and restart the server after installation, what happens is unacceptable. This gave the idea to create a small script for the prompt release of the system drive. In this scenario, removed "System queued Windows Error Reporting" and "Service Pack Backup Files". Running this script will free the system drive without restarting the server!

Download sys_disk_cleanup.cmd

@Echo off

if exist "%programdata%\microsoft\windows\wer\reportqueue" RD /S /Q "%programdata%\microsoft\windows\wer\reportqueue\" && MD "%programdata%\microsoft\windows\wer\reportqueue\"

dism /online /cleanup-image /spsuperseded