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

10 06 2011

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

21 03 2011

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

21 03 2011

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

21 03 2011

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

16 11 2010

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)
{
$desktopIni = Get-ChildItem $folder -Filter desktop.ini -Force
if ($desktopIni -ne $null)
{
$Acl = Get-Acl $desktopIni.FullName
$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

20 07 2010

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

19 07 2010

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

19 07 2010

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

2 07 2010

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!





Novell ZENworks Endpoint Security Client silent install

2 07 2010

If you want to silent install the Novell ZENworks Endpoint Security Client, you must use Wise Install Tailor (or another utility to build a MST file) and Orca.
Open the ZENworks Security Client.msi using install tailor. Walk though the wizard and at the end you’ll have a MST file.

Start Orca and open the “ZENworks Security Client.msi” and select “transforms”, followed by “new transform”.
Now browse to the table “property” and change the value of “STRBR” and change the value “Force” into “ReallySuppress”.

Click transform and close transform. Voila!








Follow

Get every new post delivered to your Inbox.