Aug/100
VB Script: Copy Active Directory Group Members
VB Script that copies all members of Group A to Group B. Requires 2 Arguments (Source Group Name, Destination Group Name)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | Set objSystemInfo = CreateObject("ADSystemInfo") strDomain = objSystemInfo.DomainShortName strSGroupDN = GetObjectDN(WScript.Arguments(0), strDomain) strDGroupDN = GetObjectDN(WScript.Arguments(1), strDomain) WScript.Echo "" WScript.Echo " Source Group: " & strSGroupDN WScript.Echo "Destination Group: " & strDGroupDN WScript.Echo "" set dicSeenGroupMember = CreateObject("Scripting.Dictionary") set objDGroup = GetObject("LDAP://" & strDGroupDN) CopyMembers "LDAP://" & strSGroupDN, dicSeenGroupMember Function CopyMembers (strGroupADsPath, dicSeenGroupMember) set objGroup = GetObject(strGroupADsPath) WScript.Echo "Adding Users to " & WScript.Arguments(1) for each objMember In objGroup.Members On Error Resume Next If (objDGroup.Add("LDAP://" & objMember.distinguishedName)) Then WScript.Echo " " & objMember.displayName & " (Already Member)" Else WScript.Echo " " & objMember.displayName End If next End Function Function GetObjectDN(strObject, strDomain) Const ADS_NAME_INITTYPE_GC = 3 Const ADS_NAME_TYPE_1779 = 1 Const ADS_NAME_TYPE_NT4 = 3 Dim objNameTranslate Dim strObjectDN On Error Resume Next : Err.Clear Set objNameTranslate = CreateObject("NameTranslate") objNameTranslate.Init ADS_NAME_INITTYPE_GC, "" objNameTranslate.Set ADS_NAME_TYPE_NT4, strDomain & "\" & strObject strObjectDN = objNameTranslate.Get(ADS_NAME_TYPE_1779) If Err.Number <> 0 Then strObjectDN = "" End If Set objNameTranslate = Nothing On Error Goto 0 GetObjectDN = strObjectDN End Function |
83 views
Apr/102
Windows 7: Desktop Icons suddenly disappear
I love Windows 7! It’s robust, fast, looks great and command lines / power shell / wmi / scripting platforms are just awesome.
In other words: It kicks the hell out of a Banana (or some other proprietary fruit I can’t remember).
However, there still are some little things that cause headache: Why would anyone do this!?
This is what I thought after my desktop shortcuts disappeared for the 3rd time after a while being unused.
Turned out there is a maintenance Task that runs as a Scheduled task under Windows 7. It executes various powershell scripts including this:
%windir%\diagnostics\scheduled\Maintenance\
RS_RemoveUnusedDesktopIcons.ps1
If you comment out line 57, you should be good to go and your Desktop Icons won’t disappear anymore:
Replace “Remove-FileList $deleteList”
with “# Remove-FileList $deleteList”
Note: To edit the file you must first take ownership and grant you permissions to it!
Hope that helps…
483 views
Apr/100
How to reset the Primary Key Index Value on an SQL Table
I recently had to reset the Primary key (Integer, AutoIncrement) from a Table I removed all entries from.
You can use the DBCC CKECKIDENT Statement to achieve this.
Reset Primary Key Index on SQL Table
USE YourDatabase
DBCC CHECKIDENT('YourTable', RESEED, 0)
This would reset the next identity value to begin at 1.
If you are receiving the following error, you might have not switched to the correct Database before executing the Statement:
Msg 2501, Level 16, State 45, Line 1
Cannot find a table or object with the name "YourTable". Check the system catalog.
Make sure you are using the “USE YourDatabase” statement before executing the DBCC .
448 views
Mar/105
Convert BMP to JPG Command Line Utility (Free)
A small and free command line utility that converts a single .bmp file or a directory containing multiple .bmp files into jpg’s.
Requires .Net Framework 2.0 or later.
UPDATE! Sorry, the previous download File was corrupted. Please download this zip file now.
Download
BMP2JPG.exe (8.0 KiB, 25,420 hits)
Help:
BMP2JPG :: Converts BMP to JPG (100% JPEG Quality only) :: Version 1.0
Converts BMP Files
Syntax :: BMP2JPG [Source Directory or File] [Destination Directory or File] [overwrite]
::
:: Examples
::
BMP2JPG "C:\Temp\My Bitmap.bmp" "C:\Temp\My JPEG File.jpg"
Converts a single File
BMP2JPG "C:\Temp\My BMP Folder" "C:\Temp\My JPEG Folder"
Converts all Files found in "C:\Temp\My BMP Folder" to "C:\Temp\My JPEG Folder"
BMP2JPG "C:\Temp\My BMP Folder" "C:\Temp\My JPEG Folder" overwrite
Converts all Files found in "C:\Temp\My BMP Folder" to "C:\Temp\My JPEG Folder"
Overwrites Existing Files
Author :: Tom Schindler, 2010 | http://www.microtom.net
Codename :: WIN32_ConvertBMP2JPG
931 views
Mar/100
How to improve Windows XP Performance
Good old Windows XP never dies! If you’re suffering of poor performance on your Windows XP Computer, you might want to try some of the following settings.
Machine Tweaks (Require Admin Rights)
Disable Startup Programs
- Logon with a User that is a member of the local Administrator Group
- Click Start
- Click Run
- Type “regedit”
- Navigate to: HKLM\Software\Microsoft\Windows\Current Version\Run
- Right Click on the “Run” key and select “Export”
- Export the key to a safe location
- Delete all Values within the Run Key except CA DSM and McAfee related keys
- Repeat step 5 to 8 for the HKCU Hive but also exclude the value ctfmon.exe from deletion
Disable unnecessary Services
- Logon with a User that is a member of the local Administrator Group
- Click Start
- Click Run
- Type “services.msc”
- Disable the following Services
Error Reporting Service
Help and Support (You will not be able to use Remote Desktop Help after disabling this)
Machine Debug Manager
Clear Temp Folder and recreate Prefetcher
- Logon with a User that is a member of the local Administrator Group
- Click Start
- Click Run
- Type “CMD”
- In the command windows type the following:
del %temp%\*.* /Q
del %windir%\Temp\*.* /Q
del %windir%\Prefetch\*.* /Q
Remove Temporary Installation Files (Hotfixes)
- Logon with a User that is a member of the local Administrator Group
- Open Windows Explorer and navigate to C:\Windows
- Make sure “Show hidden Files and Folders” is enabled in the Windows Explorer Options
- Remove Files that are compressed and start with a “$” sign EXCEPT the “$hf_mig$” folder!
Examples:
$NtUninstallKB898461$
$NtUninstallKB898463$
Empty Recycle Bin after previous steps
- Logon with a User that is a member of the local Administrator Group
- Right Click the Recycle Bin and select “Empty Recycle Bin”
Defragment the System Drive
- Logon with a User that is a member of the local Administrator Group
- Click Start
- Click Run
- Type “CMD”
- Type “defrag %SYSTEMDRIVE%”
- Hit Enter
Use a resource friendly Virus Scanner
Many Virus Scanners are even worse the a Viruses they want to protect you from. I found Microsoft Security Essentials is a very efficient and resource friendly Virus Scanner, and it’s free! :) Refer to this post to get more information: http://www.microtom.net/?p=493
User Tweaks
Disable Search for Network Folders
- Logon with the User Account
- Open Windows Explorer
- Click “Tools” – “Folder Options”
- In the “View” Tab uncheck “Automatically check for network folders and printers”
- Click “OK”
Remove Startup Programs
- Logon with the User Account
- Click Start
- Click Run
- Type %userprofile% and click “OK”
- Further navigate to “Start Menu\Programs\Startup” and delete every item in it (except if you really really REALLY(!) need one of them to start with Windows)
Cleanup Desktop
- Logon with the User Account
- Move Shortcuts (especially the ones that point to network locations) from the desktop to another location. You can also create a Folder (e.g. called “Shortcuts”) on the Desktop and move them in it.
Compress /Split PST Files
- Logon with the User Account
- Start Outlook
- For each Personal Folder File:a. Right click the Folder and select “Properties for Personal Folder…”
b. Click “Advanced”
c. Click “Compact Now” and wait for the process to finish
d. Click “OK”
e. In the Personal Folders Properties window click “Folder Size”
f. If the Total Size exceeds 1GB, split the PST file into additional PST’s
Enable “Cached Exchange Mode” in Outlook (Exchange Users Only)
- Open Microsoft Outlook 2003
- Click “Tools” – “E-mail Accounts…”
- Select “View or change existing e-mail accounts” (Selected by default) and click “Next >”
- Select the “Microsoft Exchange Server” Account and click “Change…”
- Check the check box “Use Cached Exchange Mode” (if not already checked) and click “Next >”
- Click “OK” on the Dialog
- Click “Finish”
- Restart Outlook
Remove the Desktop Wallpaper or use a .jpg image rather than .bmp
- Right click somewhere on your Desktop
- Select Properties
- In the “Display Properties” Window select the “Desktop” Tab (Second Tab)
- In the “Background” Selection Field select [None] and click “OK”
Use the Windows 2000 Theme instead of the Windows XP default theme
- Right click somewhere on your Desktop
- Select Properties
- In the “Display Properties” Window select the “Themes” Tab (First Tab)
- In the “Theme” Drop Down list, select “Windows Classic”
- Click “OK”
- Select “No” when asked to save your current Theme->Additionally you can also disable the “Windows Themes” Service
Disable Startup Programs1. Logon with a User that is a member of the local Administrator Group2. Click Start3. Click Run
4. Type “regedit”
5. Navigate to:
HKLM\Software\Microsoft\Windows\Current Version\Run
6. Right Click on the “Run” key and select “Export”
7. Export the key to a safe location
8. Delete all Values within the Run Key except CA DSM and McAfee related keys
9. Repeat step 5 to 8 for the HKCU Hive but also exclude the value ctfmon.exe from deletion
Disable unnecessary Services
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “services.msc”
5. Disable the following Services
Error Reporting Service
Help and Support
Machine Debug Manager
Clear Temp Folder and recreate Prefetcher
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. In the command windows type the following:
del %temp%\*.* /Q
del %windir%\Temp\*.* /Q
del %windir%\Prefetch\*.* /Q
Remove Temporary Installation Files (Hotfixes)
1. Logon with a User that is a member of the local Administrator Group
2. Open Windows Explorer and navigate to C:\Windows
3. Make sure “Show hidden Files and Folders” is enabled in the Windows Explorer Options
4. Remove Files that are compressed and start with a “$” sign EXCEPT the “$hf_mig$” folder!
Examples:
$NtUninstallKB898461$
$NtUninstallKB898463$
Empty Recycle Bin after previous steps
1. Logon with a User that is a member of the local Administrator Group
2. Right Click the Recycle Bin and select “Empty Recycle Bin”
Defragment the System Drive
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. Type “defrag %SYSTEMDRIVE%”
6. Hit Enter
Per User Tweaks
Disable Search for Network Folders
1. Logon with the User Account
2. Open Windows Explorer
3. Click “Tools” – “Folder Options”
4. In the “View” Tab uncheck “Automatically check for network folders and printers”
5. Click “OK”
Remove Startup Programs
1. Logon with the User Account
2. Click Start
3. Click Run
4. Type %userprofile% and click “OK”
5. Further navigate to “Start Menu\Programs\Startup” and delete every item in it (except if you really really REALLY(!) need one of them to start with Windows)
Cleanup Desktop
1. Logon with the User Account
2. Move Shortcuts (especially the ones that point to network locations) from the desktop to another location. You can also create a Folder (e.g. called “Shortcuts”) on the Desktop and move them in it.
Compress /Split PST Files
1. Logon with the User Account
2. Start Outlook
3. For each Personal Folder File:
a. Right click the Folder and select “Properties for Personal Folder…”
b. Click “Advanced”
c. Click “Compact Now” and wait for the process to finish
d. Click “OK”
e. In the Personal Folders Properties window click “Folder Size”
f. If the Total Size exceeds 1GB, split the PST file into additional PST’s
Enable “Cached Exchange Mode” in Outlook (Exchange Users Only)
1. Open Microsoft Outlook 2003
2. Click “Tools” – “E-mail Accounts…”
3. Select “View or change existing e-mail accounts” (Selected by default) and click “Next >”
4. Select the “Microsoft Exchange Server” Account and click “Change…”
5. Check the check box “Use Cached Exchange Mode” (if not already checked) and click “Next >”
6. Click “OK” on the Dialog
7. Click “Finish”
8. Restart Outlook
Remove the Desktop Wallpaper or use a .jpg image rather than .bmp
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Desktop” Tab (Second Tab)
4. In the “Background” Selection Field select [None] and click “OK”
Use the Windows 2000 Theme instead of the Windows XP default theme
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Themes” Tab (First Tab)
4. In the “Theme” Drop Down list, select “Windows Classic”
5. Click “OK”
6. Select “No” when asked to save your current Theme
*Additionally you can also disable the “Windows Themes” Service
Disable Startup Programs1. Logon with a User that is a member of the local Administrator Group2. Click Start3. Click Run
4. Type “regedit”
5. Navigate to:
HKLM\Software\Microsoft\Windows\Current Version\Run
6. Right Click on the “Run” key and select “Export”
7. Export the key to a safe location
8. Delete all Values within the Run Key except CA DSM and McAfee related keys
9. Repeat step 5 to 8 for the HKCU Hive but also exclude the value ctfmon.exe from deletion
Disable unnecessary Services
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “services.msc”
5. Disable the following Services
Error Reporting Service
Help and Support
Machine Debug Manager
Clear Temp Folder and recreate Prefetcher
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. In the command windows type the following:
del %temp%\*.* /Q
del %windir%\Temp\*.* /Q
del %windir%\Prefetch\*.* /Q
Remove Temporary Installation Files (Hotfixes)
1. Logon with a User that is a member of the local Administrator Group
2. Open Windows Explorer and navigate to C:\Windows
3. Make sure “Show hidden Files and Folders” is enabled in the Windows Explorer Options
4. Remove Files that are compressed and start with a “$” sign EXCEPT the “$hf_mig$” folder!
Examples:
$NtUninstallKB898461$
$NtUninstallKB898463$
Empty Recycle Bin after previous steps
1. Logon with a User that is a member of the local Administrator Group
2. Right Click the Recycle Bin and select “Empty Recycle Bin”
Defragment the System Drive
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. Type “defrag %SYSTEMDRIVE%”
6. Hit Enter
Per User Tweaks
Disable Search for Network Folders
1. Logon with the User Account
2. Open Windows Explorer
3. Click “Tools” – “Folder Options”
4. In the “View” Tab uncheck “Automatically check for network folders and printers”
5. Click “OK”
Remove Startup Programs
1. Logon with the User Account
2. Click Start
3. Click Run
4. Type %userprofile% and click “OK”
5. Further navigate to “Start Menu\Programs\Startup” and delete every item in it (except if you really really REALLY(!) need one of them to start with Windows)
Cleanup Desktop
1. Logon with the User Account
2. Move Shortcuts (especially the ones that point to network locations) from the desktop to another location. You can also create a Folder (e.g. called “Shortcuts”) on the Desktop and move them in it.
Compress /Split PST Files
1. Logon with the User Account
2. Start Outlook
3. For each Personal Folder File:
a. Right click the Folder and select “Properties for Personal Folder…”
b. Click “Advanced”
c. Click “Compact Now” and wait for the process to finish
d. Click “OK”
e. In the Personal Folders Properties window click “Folder Size”
f. If the Total Size exceeds 1GB, split the PST file into additional PST’s
Enable “Cached Exchange Mode” in Outlook (Exchange Users Only)
1. Open Microsoft Outlook 2003
2. Click “Tools” – “E-mail Accounts…”
3. Select “View or change existing e-mail accounts” (Selected by default) and click “Next >”
4. Select the “Microsoft Exchange Server” Account and click “Change…”
5. Check the check box “Use Cached Exchange Mode” (if not already checked) and click “Next >”
6. Click “OK” on the Dialog
7. Click “Finish”
8. Restart Outlook
Remove the Desktop Wallpaper or use a .jpg image rather than .bmp
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Desktop” Tab (Second Tab)
4. In the “Background” Selection Field select [None] and click “OK”
Use the Windows 2000 Theme instead of the Windows XP default theme
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Themes” Tab (First Tab)
4. In the “Theme” Drop Down list, select “Windows Classic”
5. Click “OK”
6. Select “No” when asked to save your current Theme
*Additionally you can also disable the “Windows Themes” Service
Disable Startup Programs1. Logon with a User that is a member of the local Administrator Group2. Click Start3. Click Run
4. Type “regedit”
5. Navigate to:
HKLM\Software\Microsoft\Windows\Current Version\Run
6. Right Click on the “Run” key and select “Export”
7. Export the key to a safe location
8. Delete all Values within the Run Key except CA DSM and McAfee related keys
9. Repeat step 5 to 8 for the HKCU Hive but also exclude the value ctfmon.exe from deletion
Disable unnecessary Services
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “services.msc”
5. Disable the following Services
Error Reporting Service
Help and Support
Machine Debug Manager
Clear Temp Folder and recreate Prefetcher
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. In the command windows type the following:
del %temp%\*.* /Q
del %windir%\Temp\*.* /Q
del %windir%\Prefetch\*.* /Q
Remove Temporary Installation Files (Hotfixes)
1. Logon with a User that is a member of the local Administrator Group
2. Open Windows Explorer and navigate to C:\Windows
3. Make sure “Show hidden Files and Folders” is enabled in the Windows Explorer Options
4. Remove Files that are compressed and start with a “$” sign EXCEPT the “$hf_mig$” folder!
Examples:
$NtUninstallKB898461$
$NtUninstallKB898463$
Empty Recycle Bin after previous steps
1. Logon with a User that is a member of the local Administrator Group
2. Right Click the Recycle Bin and select “Empty Recycle Bin”
Defragment the System Drive
1. Logon with a User that is a member of the local Administrator Group
2. Click Start
3. Click Run
4. Type “CMD”
5. Type “defrag %SYSTEMDRIVE%”
6. Hit Enter
Per User Tweaks
Disable Search for Network Folders
1. Logon with the User Account
2. Open Windows Explorer
3. Click “Tools” – “Folder Options”
4. In the “View” Tab uncheck “Automatically check for network folders and printers”
5. Click “OK”
Remove Startup Programs
1. Logon with the User Account
2. Click Start
3. Click Run
4. Type %userprofile% and click “OK”
5. Further navigate to “Start Menu\Programs\Startup” and delete every item in it (except if you really really REALLY(!) need one of them to start with Windows)
Cleanup Desktop
1. Logon with the User Account
2. Move Shortcuts (especially the ones that point to network locations) from the desktop to another location. You can also create a Folder (e.g. called “Shortcuts”) on the Desktop and move them in it.
Compress /Split PST Files
1. Logon with the User Account
2. Start Outlook
3. For each Personal Folder File:
a. Right click the Folder and select “Properties for Personal Folder…”
b. Click “Advanced”
c. Click “Compact Now” and wait for the process to finish
d. Click “OK”
e. In the Personal Folders Properties window click “Folder Size”
f. If the Total Size exceeds 1GB, split the PST file into additional PST’s
Enable “Cached Exchange Mode” in Outlook (Exchange Users Only)
1. Open Microsoft Outlook 2003
2. Click “Tools” – “E-mail Accounts…”
3. Select “View or change existing e-mail accounts” (Selected by default) and click “Next >”
4. Select the “Microsoft Exchange Server” Account and click “Change…”
5. Check the check box “Use Cached Exchange Mode” (if not already checked) and click “Next >”
6. Click “OK” on the Dialog
7. Click “Finish”
8. Restart Outlook
Remove the Desktop Wallpaper or use a .jpg image rather than .bmp
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Desktop” Tab (Second Tab)
4. In the “Background” Selection Field select [None] and click “OK”
Use the Windows 2000 Theme instead of the Windows XP default theme
1. Right click somewhere on your Desktop
2. Select Properties
3. In the “Display Properties” Window select the “Themes” Tab (First Tab)
4. In the “Theme” Drop Down list, select “Windows Classic”
5. Click “OK”
6. Select “No” when asked to save your current Theme
*Additionally you can also disable the “Windows Themes” Service
227 views

(3 votes, average: 4.67 out of 5)
(5 votes, average: 4.20 out of 5)