SCRIPT – Remove McAfee Agent / McAfee MOVE

Today I had to remove an exisint McAfee installatie from a lot computers. These computers were partly managed by McAfee ePolicy Orchestrator.

First try to remove the computers from using ePolicy Orchestrator. When you delete a computer object from the tree an option to uninstall agent will be presented. Make sure to check the checkbox before you continue.

Give it a little bit of time (let’s say 15 minutes) and the agent will be removed from the computer. I have noticed that this is not always the case. So I wrote a little script to force the uninstallation.

Here’s the script. If it does not work, try to run it for a second time.

Echo off
REM copy nvadm.exe from a working machine to a file share
copy \\servernam\sharename\McAfee\mvadm.exe c:\windows\temp /Y

REM The following is dependend of installed version, so some errors will occour. No worries, it wil work. It's done so the mgtsvc service can be stopped and removed

c:\windows\temp\mvadm disable
c:\windows\temp\mvadm config set OASStatus=0
c:\windows\temp\mvadm config set ODSStatus=0
c:\windows\temp\mvadm config set IntegrityEnabled=0

ECHO Stopping services
sc stop mvagtsvc
sc stop mvagtdrv
sc delete mvagtsvc
sc delete mvagtdrv

Echo Stopping McAfee MOVE Service
start /wait "Taskill" taskkill /IM mvagtsvc.exe /f

Echo Uninstalling McAfee MOVE
start /wait "mcafee" MsiExec.exe /X{6256F19B-18EB-4942-8A7C-5A0A9DABFA35} /q
start /wait "ReMOVE" MsiExec.exe /X{291E5CBE-DC09-48AC-B3F6-1997B3113966} /q
if exist "C:\Program Files\Mcafee\Agent\x86\frminst.exe" start /wait "mcafee" "C:\Program Files\Mcafee\Agent\x86\frminst.exe" /forceuninstall /silent

wmic product where name="McAfee Agent" call uninstall /nointeractive

Echo Removing registry keys
reg delete "HKLM\SOFTWARE\Wow6432Node\McAfee\McTray\Plugins\MovePlugin" /f
reg delete "HKLM\SOFTWARE\McAfee" /f
reg delete "HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\DC__AM__4000" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Network Associates\ePolicy Orchestrator\Application Plugins\DC__AM__4000?" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Network Associates\ePolicy Orchestrator\Application Plugins\MOVEVOFF2600" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{291E5CBE-DC09-48AC-B3F6-1997B3113966}" /f
reg delete "HKLM\SOFTWARE\WOW6432Node\McAfee" /f

Echo Removing Directories
rd "C:\Program Files (x86)\McAfee" /s /q
rd "C:\Program Files\McAfee" /s /q
rd "C:\ProgramData\McAfee" /s /q
rd "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\McAfee" /s /q
del C:\Windows\Temp\mvadm.exe /q

POWERSHELL – Set Password never expires and user cannot change password

How to search for user accounts in Active Directory and bulk set password never expires and user cannot change password.

$users = Get-ADUser -SearchBase $Oupath -filter * -Server domain.local -properties Name, PasswordNeverExpires, PwdLastSet | where-object {$_.PwdLastSet -ne 0}

foreach ($User in $users){
Set-ADUser -identity $User -PasswordNeverExpires $True -CannotChangePassword $True
}

POWERSHELL – Find users with expired passwords

You can use this script to find user accounts in Active Directory who have expired passwords and export this to a CSV.
Change the $oupath variable so it corresponds to your environment

$Oupath = "ou=users, ou=resources,dc=domain,dc=local"
$days = (get-date).AddDays(-90)
Get-ADUser -SearchBase $Oupath -filter * -Properties enabled, PasswordExpired, passwordneverexpires, passwordlastset, lastlogondate, whencreated | where {$_.enabled -eq "true" -and $_.lastlogondate -le $days -or $_.lastlogongdate -notlike "*" -and $_.passwordlastset -le $days -and $_.whencreated -le $days} | FT Export-csv -Delimiter ";" C:\Temp\Users-with-expired-passwords.csv -NoTypeInformation -Encoding Unicode

POWERSHELL – Find users who changed their password long ago

This script can be used to find members of a group (in this case domain admins) who haven’t changed their password for a long time.

$MaxAge = 180
$users= get-adgroupmember -identity "domain admins" -Server "domain.local"


Foreach ($user in $users){
     Get-AdUser -Filter {Name -eq $user.name} -Properties PasswordLastSet,LastLogonDate | Where-Object { 
     $_.PasswordLastSet -lt [DateTime]::Now.Subtract([TimeSpan]::FromDays($MaxAge)) -or 
     $_.LastLogonDate -lt [DateTime]::Now.Subtract([TimeSpan]::FromDays($MaxAge)) -or
     $_.Enabled -eq $false -or
     $_.PasswordExpired -eq $true
     } |ft
}

HOW-TO: Fix Sound Dell E6500 Windows 10 Watching video

Today I will explain how to stop the annoying sound buzzing when you play video or sound on a Dell E6500. I have a Dell 6500 which was automatically updated to Windows 10. Using Windows 7 the laptop performance was ‘ok’.

Now with Windows 10 it’s not possible to watch video’s on any website without the sound being disrupted. Video calls are also not very good possible. And YouTube is very annoying.
I tried the fix from Dell and several other things, but nevertheless..

But.. I found the fix and would like to share this with you.

I had to go to the bios settings and disable the ‘eSATA’ ports in the bios.
After that, the sound stuttering was  gone!

I hope I’ve helped you with this, happy video-ing 🙂

HOW-TO: Disable Language bar using Group Policy Preferences

After some searching I found out nobody found a solution to get rid of the Windows language bar using policies.
When deploying user settings using Group Policy Preferences (GPP) I actually managed to get this done!

Save the following text as settings.XML, create and open a new group policy object in Active Directory and drag the XML file into the registry portion of the user settings.

Now you should see a bunch of keys which will be deleted and/or updated.

Remember: this is the setting for Dutch Language (0413) and US-International keyboard (00020409)

One more thing, you need RES Workspace Manager because the settings need to be applied before explorer.exe is started..

Please let me know if this post helped you!

<Collection clsid="{53B533F5-224C-47e3-B01B-CA3B3F3FF4BF}" name="Set Keyboard Settings" disabled="0" desc="Created by Sebastiaan van Weelden (Ictivity) 10-09-2013" bypassErrors="1" changed="2013-09-10 14:29:33" uid="{F8F2590B-9CE8-4ED3-A4CD-634FE931E4A9}"><Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="2" status="2" image="8" changed="2013-08-22 07:40:21" uid="{2AACBDB8-F8D2-482F-BB49-56B3E018F8E2}" userContext="1" bypassErrors="1" disabled="0"><Properties action="D" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Preload" name="2" type="REG_SZ" value="00000413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="3" status="3" image="8" changed="2013-08-22 07:40:12" uid="{F9AA01F0-1686-469B-8FBF-8D55CF3DA68E}" userContext="1" bypassErrors="1" disabled="0"><Properties action="D" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Preload" name="3" type="REG_SZ" value="00000413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="1" status="1" image="6" changed="2013-08-22 07:41:01" uid="{7744E6F3-E616-4B1C-B647-FD4CD9F6CC34}" userContext="1" bypassErrors="1" disabled="0"><Properties action="R" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Preload" name="1" type="REG_SZ" value="00000413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="00000413" status="00000413" image="7" userContext="1" bypassErrors="1" changed="2013-08-22 07:41:48" uid="{ED84566C-7A8D-4E07-968F-130D1B1A481B}" disabled="0"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Substitutes" name="00000413" type="REG_SZ" value="00020409"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="d0010413" status="d0010413" image="8" changed="2013-08-22 07:50:56" uid="{7192BEAB-D0C2-4F1C-B8DA-D11A88306D7D}" userContext="1" bypassErrors="1" disabled="0"><Properties action="D" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Substitutes" name="d0010413" type="REG_SZ" value="00020409"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Language Hotkey" status="Language Hotkey" image="7" changed="2013-08-22 07:59:00" uid="{B0714A5B-7721-4CF3-9AA0-D2A4A83B93E5}" userContext="1" bypassErrors="1" disabled="0"><Properties action="U" displayDecimal="1" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Toggle" name="Language Hotkey" type="REG_SZ" value="3"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Layout Hotkey" status="Layout Hotkey" image="7" changed="2013-08-22 08:06:57" uid="{121A34F8-C5C0-433B-84DF-EBB26C143711}" disabled="0"><Properties action="U" displayDecimal="1" default="0" hive="HKEY_CURRENT_USER" key="Keyboard Layout\Toggle" name="Layout Hotkey" type="REG_SZ" value="3"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="ShowStatus" status="ShowStatus" image="12" changed="2013-08-22 13:11:42" uid="{B66F08A6-A0E0-489A-A0E3-AD458709AFC5}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="1" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\LangBar" name="ShowStatus" type="REG_DWORD" value="00000003"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Default" status="Default" image="7" changed="2013-08-22 13:13:10" uid="{0F3FAB83-C2BA-49B5-A683-771F899359EC}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\Assembliesx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}" name="Default" type="REG_SZ" value="{00000000-0000-0000-0000-000000000000}"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Profile" status="Profile" image="7" changed="2013-08-22 13:13:05" uid="{877D2AB8-636E-40F8-81D9-F93DE83519BA}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\Assembliesx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}" name="Profile" type="REG_SZ" value="{00000000-0000-0000-0000-000000000000}"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="KeyboardLayout" status="KeyboardLayout" image="12" changed="2013-08-22 13:13:45" uid="{535C6CDA-49DA-422C-9D37-3EC6F4C49E96}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\Assembliesx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}" name="KeyboardLayout" type="REG_DWORD" value="F0010413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="0x00000409" status="0x00000409" image="3" changed="2013-08-22 13:14:47" uid="{C2A8654B-EA01-428C-873F-495E5A976E21}" userContext="1" bypassErrors="1"><Properties action="D" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\Assembliesx00000409" name="" type="REG_SZ" value=""/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="00000001" status="00000001" image="3" changed="2013-08-22 13:15:21" uid="{F2E8411F-473E-4D4B-989B-564232A6F881}"><Properties action="D" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\SortOrder\AssemblyItemx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}0000001" name="" type="REG_SZ" value=""/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="CLSID" status="CLSID" image="7" changed="2013-08-22 13:16:06" uid="{165AEF77-9D88-4CD5-94DE-BAD5BF5CA9AD}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\SortOrder\AssemblyItemx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}0000000" name="CLSID" type="REG_SZ" value="{00000000-0000-0000-0000-000000000000}"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Profile" status="Profile" image="7" changed="2013-08-22 13:16:25" uid="{9AC40BCF-0E8C-458E-AC51-8A31178DF53D}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\SortOrder\AssemblyItemx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}0000000" name="Profile" type="REG_SZ" value="{00000000-0000-0000-0000-000000000000}"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="KeyboardLayout" status="KeyboardLayout" image="12" changed="2013-08-22 13:16:57" uid="{BAFA25B0-17B6-4B64-9134-65BD87922474}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\SortOrder\AssemblyItemx00000413\{34745C63-B2F0-4784-8B67-5E12C8701A31}0000000" name="KeyboardLayout" type="REG_DWORD" value="F0010413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="00000000" status="00000000" image="7" changed="2013-08-22 13:17:38" uid="{058D19D0-2755-4CE5-A304-92F7E677E83D}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\SortOrder\Language" name="00000000" type="REG_SZ" value="00000413"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Top" status="Top" image="12" userContext="1" bypassErrors="1" changed="2013-08-22 13:18:27" uid="{33561FDC-1BF7-4298-BE78-463CBDD621B9}"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\MSUTB" name="Top" type="REG_DWORD" value="00000000"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Left" status="Left" image="12" changed="2013-08-22 13:18:50" uid="{28A8B6F2-F4B0-4845-B44D-C391FCAE1D22}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\MSUTB" name="Left" type="REG_DWORD" value="00000580"/></Registry>  <Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="KeyboardLayout" status="KeyboardLayout" image="12" changed="2013-08-22 13:19:38" uid="{3B36E33D-837C-4C0E-AF79-0EDAB45394A5}" userContext="1" bypassErrors="1"><Properties action="U" displayDecimal="0" default="0" hive="HKEY_CURRENT_USER" key="Software\Microsoft\CTF\RemoteSession" name="KeyboardLayout" type="REG_DWORD" value="00000000"/></Registry> </Collection>

Remove RES Hyperdrive Right Click Context menu

I wanted to remove the RES HyperDrive right-click menu which was created by the installer. It was quite easy, Just import the following keys in the registry

Windows Registry Editor Version 5.00

-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shellex\ContextMenuHandlers\ContextMenuExtensionWithIcons

-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shellex\ContextMenuHandlers\ContextMenuExtensionWithIcons

-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ContextMenuExtensionWithIcons

Save Certificates with RES Workspace Manager

Ever wondered why (personal) certificate information is not saved when you use folder redirection and RES Workspace Manager? Well the cause is simple, the solution also 🙂

When you choose to redirect the Application Data folder the certificate store folders are NOT redirected (bug??). They resist in the default folder. So when you use a mandatory profile and RES Workspace Manager this information is lost when you logout and your user has to enter the 24-digit passphrase again every day 😉

The solution is quick, dirty and simple. Create a User Preference will that store the following:

%userprofile%\AppData\Roaming\Microsoft\SystemCertificates
%userprofile%\AppData\Roaming\Microsoft\Protect
%userprofile%\AppData\Roaming\Microsoft\Credentials
%userprofile%\AppData\Roaming\Microsoft\Crypto
%userprofile%\AppData\Roaming\Microsoft\CLR Security Config
%userprofile%\AppData\Roaming\Microsoft\CryptNetUrlCache

HKEY_CURRENT_USER\Software\Microsoft\Cryptography
HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider
HKEY_CURRENT_USER\Software\Microsoft\SystemCertificates

Tell the news to your users and you’ll be their hero (for one day) 🙂

HOW-TO: FIX NTP Time Settings

What to do when your domain controllers don’t sync time ery well??

On the PDC Emulator run the following in a command prompt:

  • W32tm /config /manualpeerlist:time.nrc.ca /syncfromflags:manual /reliable:yes /update
  •  W32tm /resync /rediscover
  • Restart the time service: net stop w32time && net start w32time

On every Domain Controller that is not holding the PDC Emulator role, run the following in a command prompt:

  • w32tm /config /syncfromflags:domhier /update
  •  W32tm /resync /rediscover
  • Restart the time service: net stop w32time && net start w32time

Fixed?? IN my case it was 🙂

Set Internet Explorer As Default Browser Through Registry

The following registry entries must all be changed in order to set Internet Explorer as the default browser and pass the ‘Would you like to set Internet Explorer as default browser’ popup.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice]
“Progid”=”IE.HTTP”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice]
“Progid”=”IE.HTTPS”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice]
“Progid”=”IE.FTP”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\UserChoice]
“Progid”=”IE.AssocFile.HTM”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice]
“Progid”=”IE.AssocFile.HTM”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mht\UserChoice]
“Progid”=”IE.AssocFile.MHT”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mhtml\UserChoice]
“Progid”=”IE.AssocFile.MHT”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.partial\UserChoice]
“Progid”=”IE.AssocFile.PARTIAL”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.svg\UserChoice]
“Progid”=”IE.AssocFile.SVG”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url\UserChoice]
“Progid”=”IE.AssocFile.URL”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.website\UserChoice]
“Progid”=”IE.AssocFile.WEBSITE”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xht\UserChoice]
“Progid”=”IE.AssocFile.XHT”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xhtml\UserChoice]
“Progid”=”IE.AssocFile.XHT”

[HKEY_CURRENT_USER\Software\Clients\StartMenuInternet]
@=”IEXPLORE.EXE”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\MIMEAssociations\text/html\UserChoice]
“Progid”=”IE.text/html”

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\MIMEAssociations\message/rfc822\UserChoice]
“Progid”=”IE.message/rfc822”

Enable or Disable Client For Microsoft Networks and other Lan Settings using script

Yesterday I was searching the web for a script that would disable the client for Microsoft networks and some other protocols.
I could not find it in the first 10 pages of my search on Google.
Finally I found a great solution that i would like to share with you, and tag my post well so anyone can find it more quickly than I did 🙂

I found the application nvspbind that I could use to disable or enable the following stuff:

  • Broadcom Advanced Server Program Driver
  • Brocade 10G Ethernet Service
  • Intel(R) Advanced Network Services Protocol
  • Link-Layer Topology Discovery Mapper I/O Driver
  • Client for Microsoft Networks
  • NetBIOS Interface
  • WINS Client(TCP/IP) Protocol
  • QoS Packet Scheduler
  • Link-Layer Topology Discovery Responder
  • File and Printer Sharing for Microsoft Networks
  • Microsoft NetbiosSmb
  • Internet Protocol Version 4 (TCP/IPv4)
  • Internet Protocol Version 6 (TCP/IPv6)
  • Microsoft Virtual Network Switch Protocol

I’ve put them all together in a batch script:

REM Configure Network Settings

set lan="LAN Verbinding"

REM brcm_blfp (Broadcom Advanced Server Program Driver)
"%~DP0nvspbind.exe" /d "%lan%" brcm_blfp

REM bnad_imp (Brocade 10G Ethernet Service)
"%~DP0nvspbind.exe" /d "%lan%" bnad_imp

REM iansprotocol (Intel(R) Advanced Network Services Protocol)
"%~DP0nvspbind.exe" /d "%lan%" iansprotocol

REM ms_lltdio (Link-Layer Topology Discovery Mapper I/O Driver)
"%~DP0nvspbind.exe" /d "%lan%" ms_lltdio

REM ms_msclient (Client for Microsoft Networks)
"%~DP0nvspbind.exe" /d "%lan%" ms_msclient

REM ms_netbios (NetBIOS Interface)
"%~DP0nvspbind.exe" /d "%lan%" ms_netbios

REM ms_netbt (WINS Client(TCP/IP) Protocol)
"%~DP0nvspbind.exe" /d "%lan%" ms_netbt

REM ms_pacer (QoS Packet Scheduler)
"%~DP0nvspbind.exe" /d "%lan%" ms_pacer

REM ms_rspndr (Link-Layer Topology Discovery Responder)
"%~DP0nvspbind.exe" /d "%lan%" ms_rspndr

REM ms_server (File and Printer Sharing for Microsoft Networks)
"%~DP0nvspbind.exe" /d "%lan%" ms_server

REM ms_smb (Microsoft NetbiosSmb)
"%~DP0nvspbind.exe" /d "%lan%" NetbiosSmb

REM ms_tcpip (Internet Protocol Version 4 (TCP/IPv4))
"%~DP0nvspbind.exe" /d "%lan%" ms_tcpip

REM ms_tcpip6 (Internet Protocol Version 6 (TCP/IPv6))
"%~DP0nvspbind.exe" /d "%lan%" ms_tcpip6

REM vms_pp (Microsoft Virtual Network Switch Protocol)
"%~DP0nvspbind.exe" /d "%lan%" vms_pp

That's it!

Use Remote Server Administration Tools RSAT on Windows 7 SP1

Last week I discovered that RSAT cannot be installed on Windows 7 SP1 because of some stupid install check.
When you want to use the RSAT you can accomplish this using the following procedure:

Download RSAT here.

* Unpack the .MSU with 7zip or another unzip utility to let’s say c:\TEMP\RSAT.
* use the package manager for the install:

pkgmgr.exe /n:%temp%\RSAT\Windows6.1-KB958830-x64.xml

* Now watch the taskmanager the process pkgmgr.exe until it automatically closes (this will take several minutes).
* Go to the control panel and in Programs and Windows Features you can add the desired feature you want.

Note: when you’ve got RSAT installed on your computer prior installing Windows 7 SP1, then RSAT will already be available and you don’t need this workaround.

Deploy Printers Using Group Policy Preferences

Deploying printer in Windows Server 2008 using grou policy preferences is pretty straightforward. The web is filled with many manuals like this one: http://www.msserveradmin.com/the-one-reason-you-should-use-group-policy-preferences/

What seems to be a major problem is ‘remembering’ the default printer when using replace option. The default behavour of Windows is the first added printer is being set as the default.
To resolve this, i’ve created a script (with some help from a great collegue). You do need te have a roaming profile or a tool like Immidio profiles to save current use keys. Add the logon.vbs and the logoff.vbs scripts to the user policy.

Set the c:\windows\system32\cscript.exe as application with the logon.vbs as a parameter.

 logon.vbs

Option Explicit
Dim wshShell, strSavekey, strPrtName, objNetwork
'---------------------------------------------------------------------
'Save default printer login script written by 
'Sebastiaan van Weelden and Edward Dijk
'Ictivity 2011
'---------------------------------------------------------------------
' Set string values
strSaveKey = "HKCU\SOFTWARE\Ictivity\"
Set WSHShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
strPrtName = WshShell.RegRead (strSaveKey & "Printer Name")
'wscript.echo strPrtName
'Add 4 seconds delay so the printers can be added by the policy
WScript.Sleep(4000)
objNetwork.SetDefaultPrinter strPrtName

'Exit script
WScript.Quit

Logoff.vbs reads the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device and cuts it into pieces.
It creates some keys in hkey_current_user\software\ictivity.
These keys are being ‘read’ at logon and after a while (this time can be set in logon.vbs) the last used printer is set as default.

logoff.vbs

Option Explicit
Dim strKey, wshShell, strSavekey, strPrtName, strPrtSpool, strPrt
Dim strValue
'---------------------------------------------------------------------
'Save default printer logout script written by 
'Sebastiaan van Weelden and Edward Dijk
'Ictivity 2011
'---------------------------------------------------------------------
' Set string values
strSaveKey = "HKCU\SOFTWARE\Ictivity\"
strPrtName = "Printer Name"
strPrt = "Printer Port"
strPrtSpool = "Spooler"
' Create WScript Shell object to read the registry
Set wshShell = CreateObject( "WScript.Shell" )
' Read the current default printer from registry
strKey = "HKEY_CURRENT_USER\Software\Microsoft" _ 
& "\Windows NT\CurrentVersion\Windows\Device"
strValue = Split( wshShell.RegRead( strKey ), "," )
'Write Printer Name
WshShell.RegWrite "HKCU\SOFTWARE\Ictivity\" & strPrtName, strValue(0), "REG_SZ"
'Write Spooler
WshShell.RegWrite "HKCU\SOFTWARE\Ictivity\" & strPrtSpool, strValue(1), "REG_SZ"
'Write Printer Port
WshShell.RegWrite "HKCU\SOFTWARE\Ictivity\" & strPrt, strValue(2), "REG_SZ"
'Exit script
WScript.Quit

The last thing to do is changing the computer policy. Windows will refresh the policy en thereby also readd the printers. This will result in a wrong default printer.
Change the following setting in the computer policy:


Good luck!

Special thanx to my script buddy Edward Dijk

Create Windows 7 image with Novell ZCM

Last week I created a Windows 7 Professional image with Novell ZCM. When I deployed the image to a workstation, it displayed an error when Windows was started:

Windows failed to start. A recent hardware or software change might
be the
cause. File: \Windows\system32\winload.exe Status: 0xc0000225 Info:
The selected entry could not be loaded because the application is missing or corrupt.”

The Solution was very simple:
Execute the following commands before sealing your image with sysprep:

bcdedit /set {bootmgr} device boot
bcdedit /set {default} device boot
bcdedit /set {default} osdevice boot

Now you’ll be able to deploy your image to the workstations!

HOW-TO: Revert renamed user homefolders to My Documents

Today I had this weird problem because of some stupid brain farts by the Microsoft developers team.
When you redirect the my documents folder to a network location let’s say \\servername\sharename\%username% then the %username% looks like it is renamed to my documents, FOR EVERY USER!)
So you’ll have a folder with in my case hundreds of my documents folders..

You definitely don’t want this behaviour!

Apparently this is by design http://support.microsoft.com/kb/947222.
When you take a look at this article you really want to choose between creating a subfolder under the redirected folder in the Universal Naming Convention (UNC) path.

For example, the following UNC path: \\server\users\username\Documents

The best method is the third one from the article: Do not grant the Read permission to the administrator for the Desktop.ini files on the server.

To do this, follow these steps:
Note If more than one Desktop.ini file exists, follow these steps for all the Desktop.ini files.
Right-click the Desktop.ini file, click Properties, and then click the Security tab.
In the Group or user names pane, click Administrators.
Click to select the Deny check box for the Read permission.
Click OK.

You can also use this great PowerShell scipt:

$folders = Get-ChildItem | where-object {$_.psiscontainer}
foreach ($folder in $folders)
{
$ErrorActionPreference = "SilentlyContinue"
$desktopIni = Get-ChildItem $folder -Filter desktop.ini -Force

if ($desktopIni -ne $null)
{
$Acl = (Get-Item $desktopIni.FullName -Force).GetAccessControl("Access")
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule `
("groupName","Read","Deny")
$Acl.SetAccessRule($Ar)
Set-Acl $desktopIni.FullName $Acl
}
}

Thanx to this great blog by Richard Willis!!

Enable Sound Icon Windows XP using script

Today my customer wanted to have the volume icon in the taskbar enabled.
Easy, was the first thought. But during my search i investiogated it was a bit harder.

Here’s the solution:
Import the following registry key:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\SysTray" /v Services /t REG_DWORD /d 31 /f

Start the following program:
C:\WINDOWS\system32\systray.exe

Voilà !

Show Dell Asset tag / part number / serial number using VB-script

This little vb-script shows the Asset tag / part number of serial number of your Dell computer.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSMBIOS = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")

For Each objSMBIOS in colSMBIOS
Wscript.Echo "Part Number: " & objSMBIOS.PartNumber
Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
Wscript.Echo "Asset Tag: " & objSMBIOS.SMBIOSAssetTag
Next

Windows Update Error 0x8024000C

Today i discovered a solution for a problem with my own laptop. Windows update comes with the error 0x8024000C when i manually click on Windows Update.
Today the windows 7 solution center told me windows updates could not install. When i take a look in the windows update.log, located at c:\Windows\WindowsUpdate.log, i saw the error: WARNING: Returning due to error from GetDownloadProgressUx, error = 0x8024000C

When i visit customers, i always need to fill in a proxy server. This was exactly the problem, and as i don’t frequently use Internet Explorer this problem occured. I was able to solve it by simply deleting the folowing registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
“WinHttpSettings”
Then i restarted the windows update service and checked for updates. yet another problem solved 🙂

Dell OptiPlex 740 i.c.m. Novell ZENworks Endpoint Security Client

Yesterday I was facing a annoying problem. Once a Dell OptiPlex 740 was reimaged and the Novell Zenworks Endpoint Security Client was installed, a blue screen occurred at the next startup. The problem occurred almost immediately at booting.

The cause was a old raid driver nvata.inf (date 2006) which belongs to the nForce4 chipset.
With the new driver (DriverVer=08/18/2008,10.3.0.42) it was all working fine. I downloaded it from www.nvidia.com

Using devcon, I updated the existing devices:

devcon update C:\Drv\B2\nvgts.inf  “PCI\VEN_10DE&DEV_0266&SUBSYS_01EC1028&REV_A1”
devcon update C:\Drv\B2\nvgts.inf  “PCI\VEN_10DE&DEV_0267&SUBSYS_01EC1028&REV_A1”

devcon update C:\Drv\B2\nvgts.inf  “PCI\VEN_10DE&DEV_0266&SUBSYS_01EC1028&REV_A1”
devcon update C:\Drv\B2\nvgts.inf  “PCI\VEN_10DE&DEV_0267&SUBSYS_01EC1028&REV_A1”

If you want to know how to install the Zenworks Endpoint Security Client silent, click here!