Thursday, February 27, 2014

Clipboard not working in Windows 2008 RDP Session


There maybe instances that you find that you are unable to use the clipboard operations in a Remote Desktop Session in Windows 2008.

To resolve the issue, please follow the below

 Ensure that the fDisableClip set to 0 under
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Winstations\RDP-Tcp

If fDisableClip is set to 1 rdpclip.exe will terminate, because clipboard mapping is disabled. Check that rdpclip is still listed under Addins

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Addins\Clip Redirector
Name REG_SZ RDPClip
Type REG_DWORD 0x00000003

Thursday, February 6, 2014

Windows cannot obtain the domain controller name for your computer network. (An unexpected network error occurred. ). Group Policy processing aborted.

You may encounter the below in Windows 2003 Servers when attempting to perform gpupdate to refresh the group policies

Error:
Event Type: Error
Event Source: Userenv
Event Category: None
Event ID: 1054
User:  NT AUTHORITY\SYSTEM
Computer: SERVER
Description:
Windows cannot obtain the domain controller name for your computer network. (An unexpected network error occurred. ). Group Policy processing aborted.
For more information, see Help and Support Center athttp://go.microsoft.com/fwlink/events.asp


To overcome this:
Create the registry keys as below and restart the server
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
“GpNetworkStartTimeoutPolicyValue”=dword:0000003c
“GroupPolicyMinTransferRate”=dword:00000000
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
“GroupPolicyMinTransferRate”=dword:00000000

Friday, November 1, 2013

Windows Update via VBS

Put together something that will enable you to perform Windows Update by means of the vbs.
In this vbs, I have decided that I do not want to include any updates for Dot Net Framework and Windows Search.

'ServerSelection values
ssDefault = 0
ssManagedServer   = 1
ssWindowsUpdate   = 2
ssOthers          = 3

'InStr values
intSearchStartChar = 1

dim strTitle

Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

updateSearcher.ServerSelection = ssWindowsUpdate
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")

WScript.Echo "List of applicable items on the machine:"

For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> " & update.Title
Next

If searchResult.Updates.Count = 0 Then
    WScript.Echo "There are no applicable updates."
    WScript.Quit
End If

WScript.Echo vbCRLF & "Creating collection of updates to download:"

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

For I = 0 to searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    addThisUpdate = false
if instr(lcase(update.title),".net framework") = 0 then  
if instr(lcase(update.title),"search") = 0 then  
If update.InstallationBehavior.CanRequestUserInput = true Then
        WScript.Echo I + 1 & "> skipping: " & update.Title & _
        " because it requires user input"
    Else
        If update.EulaAccepted = false Then
            WScript.Echo I + 1 & "> note: " & update.Title & _
            " has a license agreement that must be accepted:"
            WScript.Echo update.EulaText
            WScript.Echo "Do you accept this license agreement? (Y/N)"
            ''strInput = WScript.StdIn.ReadLine
            strInput = "Y"
            WScript.Echo
            If (strInput = "Y" or strInput = "y") Then
                update.AcceptEula()
                addThisUpdate = true
            Else
                WScript.Echo I + 1 & "> skipping: " & update.Title & _
                " because the license agreement was declined"
            End If
        Else
            addThisUpdate = true
        End If
    End If
End if
End if
    If addThisUpdate = true Then
        WScript.Echo I + 1 & "> adding: " & update.Title
        updatesToDownload.Add(update)
    End If
Next

If updatesToDownload.Count = 0 Then
    WScript.Echo "All applicable updates were skipped."
    WScript.Quit
End If
   
WScript.Echo vbCRLF & "Downloading updates..."

Set downloader = updateSession.CreateUpdateDownloader()

downloader.Updates = updatesToDownload
 Set downloadResult = downloader.Download()
   WScript.Echo "Download Result: " & downloadResult.ResultCode
'downloader.Download()

Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")

rebootMayBeRequired = false

WScript.Echo vbCRLF & "Successfully downloaded updates:"

For I = 0 To searchResult.Updates.Count-1
    set update = searchResult.Updates.Item(I)
    If update.IsDownloaded = true Then
        WScript.Echo I + 1 & "> " & update.Title
        updatesToInstall.Add(update)  
        If update.InstallationBehavior.RebootBehavior > 0 Then
            rebootMayBeRequired = true
        End If
    End If
Next

If updatesToInstall.Count = 0 Then
    WScript.Echo "No updates were successfully downloaded."
    WScript.Quit
End If

If rebootMayBeRequired = true Then
    WScript.Echo vbCRLF & "These updates may require a reboot."
End If

WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
''strInput = WScript.StdIn.ReadLine
strInput = "Y"
WScript.Echo

If (strInput = "Y" or strInput = "y") Then
    WScript.Echo "Installing updates..."
    Set installer = updateSession.CreateUpdateInstaller()
    installer.Updates = updatesToInstall
    Set installationResult = installer.Install()
   
    'Output results of install
    WScript.Echo "Installation Result: " & _
    installationResult.ResultCode
    WScript.Echo "Reboot Required: " & _
    installationResult.RebootRequired & vbCRLF
    WScript.Echo "Listing of updates installed " & _
    "and individual installation results:"
   
    For I = 0 to updatesToInstall.Count - 1
        WScript.Echo I + 1 & "> " & _
        updatesToInstall.Item(i).Title & _
        ": " & installationResult.GetUpdateResult(i).ResultCode        
I = I + 1
    Next
End If