Thursday, March 17, 2005

Exchange 2003 SP1 Registry Updates.

It transpires when you install E2k3 SP1 onto a server, the reg key

HKLM\SOFTWARE\Microsft\Updates\Exchange Server 2003\SP1 and subfolders is deleted to be replaced by

HKLM\SOFTWARE\Microsft\Updates\Exchange Server 2003\SP2

SP1 also removes the $ExchUnintstall directories in c:\winnt

Strange as that removes all trails of what hotfixes you did have installed Pre-SP1..

A pain for me as we have to audit old Hotfixes to ensure they were installed..

Tuesday, March 08, 2005

HP / Compaq Rib board detector

Get asked a lot if a server the other side of the world has a rib board installed..


This little script lets me know.


' Rib board detector.
' Scans list of servers for rib boards
' (c) 2005 Woosie


const HKEY_LOCAL_MACHINE = &H80000002
Const ForReading = 1, ForWriting = 2
Dim fso, MyFile, FileNam
Dim strComputer,TheLeft,TheDoctor
Set StdOut = WScript.StdOut
FileNam=InputBox ("Enter Target Server for RIB Board detection ?")
strcomputer = FileNam
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_
strComputer & "rootdefault:StdRegProv")
strKeyPath = "SYSTEMCurrentControlSetEnumRootLEGACY_CPQRIB000"
strValueName ="DeviceDesc"
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,strValue
IF LEN(strValue)>4 then
msg=MsgBox("Rib board installed on " & strComputer)
else
msg=MsgBox("No rib board installed on " & strComputer)
end if

How do I query a domain local group ?

How do I query a domain local group ? Suppose you are in Domain A and are member of a domain local group in Domain B. The Domain A DC does not know about it, nor does the GC. Only the Domain B DC knows about it. I finally came up with this solution. It is slow though as it has to query the AD tree..


'==========================================================================
'
' NAME: DomainLocalGroup.vbs
'
' AUTHOR: Woosie
' DATE : 02-03-2005
'
' COMMENT: Scan AD Tree looking for local group membership and then output
' list to screen.
'
'==========================================================================


Dim localgroups()
localgroup=0
struser = InputBox("User to assess local group membership (e.g. cn=bennnett_s) ?","Local Group Scanner")
' change next line to point to your root AD path.
Set oDomain = GetObject("[link]")
WScript.Echo("Searching Domain a.. Please wait..")
EnumOU(oDomain)


WScript.Echo (struser & " is a member of : ")
For myloop=0 To localgroup
WScript.Echo(localgroups(myloop))
next
Wscript.Quit


Function EnumOU(oContainer)
For Each oObj In oContainer
For Each sClass in oObj.ObjectClass
If LCase(sClass) = "organizationalunit" Then
WScript.echo "Searching " & oObj.AdsPath
EnumOU(oObj)
Else
If LCase(sclass) = "group" Then
WScript.Echo oobj.name & " " & oObj.AdsPAth
strPath =oObj.AdsPAth
set objGroup = GetObject(strPath)
for each objMember In objGroup.Members
splitme=split(objMember.Get("distinguishedname"),",")
if lcase(splitme(0))=lcase(struser) Then
localgroup=localgroup+1
ReDim Preserve localgroups(localgroup)
localgroups(localgroup-1)=strpath
Wscript.Echo struser & " is a member of local group : " & strpath
End if
Next
End If
End If
Next
Next
End Function