Archive - February 2010
"All our knowledge has it orgins in our perceptions." - Leonardo da Vinci
Δ
SSM
What is SSM?
SSM (System Software Manager) is a free solution provided from HP that streamlines the mass deployment of system software updates.
SSM reduces the complexity of system software management by delivering the following capabilities:
1 Deploying system software updates (for drivers and BIOS, for example) from a centralized file store to multiple client PCs simultaneously and automatically.
2 Deploying customer-created update packages.
3 Enforcing BIOS configurations and passwords.
4 Logging the changes made to each computer.
SSM Options
1 Rebooting the client machine so that an update
takes immediate effect or not reboot so the user can continue working.
2 Displaying a status bar so that the user can monitor
progress.
3 Creates a summary report that can be uploaded to a centralized share for later
analysis.
4 The SSM.exe can be deployed through scripts or
other software management systems.
SSM Basic Usage
1 Download, Run the SSM SoftPaq to extract the SSM program and support files.
2 Create and share a directory that will be used as the file store.
3 Copy SSM.EXE and SSM.CAB to the file store.
4 Download product (desktop, laptop, etc)
softpaqs. Example file store: c:\SSMFS, or share: \\MyServer\SSMFS
Place all SoftPaq files (unpacked) in the file store created in step
2
5 Run SSM in
Admin mode to configure
6 On each client computer, run SSM in Update Mode by specifying the
UNC path to the filestore on the command line:
{\\MyServer\SSMFS\SSM.exe \\MyServer\SSMFS /Accept /Report}
7 View log of actions performed
> View from Start/Run: %temp%\%computername%.htm.
> Review for list of software applicable to the system, updates
performed, and any errors
Basic Flow Diagram
|
Δ SysInternals BGInfo Dual Screen Limitation
What is the BGInfo Dual Screen Limitation?
How many times have you walked up to a system in
your office and needed to click through several diagnostic windows to remind
yourself of important aspects of its configuration, such as its name, IP
address, or operating system version? If you manage multiple computers, you
probably need BGInfo. It automatically displays relevant information about a
Windows computer on the desktop's background, such as the computer name, IP
address, service pack version, and more. You can edit any field as well as the
font and background colors, and can place it in your startup folder so that it
runs every boot, or even configure it to display as the background for the logon
screen. Because BGInfo simply writes a new desktop bitmap and exits, you don't
have to worry about it consuming system resources or interfering with other
applications.
So,
BGInfo is that great little utility that displays basic computer info in a corner of your
screen. And, it is a great tool indeed! However, there are some limitations that could be a deal breaker for many Desktop Admins out there; BGInfo doesn't handle wallpaper so well when there are 2
or more monitors involved. This is how BGInfo works, it overlays the PC info over an existing user's wallpaper.
Simple right? That works quite well if the user only has a single display. If the user has a dual display setup, you would think BGInfo would just overlay the info right over the wallpaper on both monitors. No such luck. It actually changes the orientation of the user's wallpaper and centers or streches the wallpaper across BOTH monitors. The result is not an aesthetically pleasing one, trust me. So how do
use BGInfo and allow the wallpaper to stay in its original orientation? Well, that is much easier said than done.
So what you will see here is the BGInfo shortcut I have created, and what was
required to achieve our objectives.
BgInfo website
Objective |
Create BGInfo shortcut that acts as dual screen fix Must
be transparent to the enduser Must use and keep the enduser's wallpaper Make
sure the shortcut works on different video cards Make sure the shortcut
works with different screen resolutions Make sure the shortcut works on
different screen orientations |
On error resume next Set objShell = CreateObject("Wscript.Shell") SystemName = "localhost" set tmpObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & SystemName & "\root\cimv2").InstancesOf ("Win32_ComputerSystem") for each tmpItem in tmpObj MakeModel = trim(tmpItem.Manufacturer) & " " & trim(tmpItem.Model) next '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Hewlett-Packard HP Compaq dc7900 Small Form Factor" then strReg1 = "regedit /s " & chr(34)&"C:\Program Files\BGInfo\schemes.reg"&chr(34) objShell.Run strReg1,9, True objShell.Run strReg2,9, True WScript.Sleep 1000 end if ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set tmpObj = Nothing: Set tmpItem = Nothing If MakeModel = "Hewlett-Packard HP EliteBook 6930p" then strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent"
'strExtra = "CMD /C START C:\WINDOWS\ClonedProfile.lnk"'save an ATI Profile names ClonedProfile, located in the ATI Control Panel 'strTest = chr(34)&"C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"&chr(34)&" Start Load profilename="&chr(34)&"HH"&chr(34) 'strTest = chr(34)&"C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"&chr(34)&" Start Load profilename="&chr(34)&"HH2"&chr(34) 'strTest = chr(34)&"C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"&chr(34)&" Start Load profilename="&chr(34)&"HH3"&chr(34)
objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, False'disable this if you enable the strExtra objShell.Run strExtra,0, False'enable this to run the ClonedProfile Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Hewlett-Packard HP Compaq dc7900 Small Form Factor" then const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services\ialm\Device0" strValueName = "Display1_DisplaySize" oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_ strValueName,strValue1
For i = lBound(strValue1) to uBound(strValue1) 'msgbox strValue1(i) 'strValue1 = strValue1 Next Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services\ialm\Device0" strValueName = "Display2_DisplaySize" oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_ strValueName,strValue2
For i = lBound(strValue2) to uBound(strValue2) 'msgbox strValue2(i) 'strValue2 = strValue2 Next
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\ControlSet001\Services\ialm\Device0" strValueName = "Display1_UID1" oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_ strValueName,strValue3
For i = lBound(strValue3) to uBound(strValue3) 'msgbox strValue3(i) 'strValue2 = strValue3 Next Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\ControlSet001\Services\ialm\Device0" strValueName = "Display2_UID1" oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_ strValueName,strValue4
For i = lBound(strValue4) to uBound(strValue4) 'msgbox strValue4(i) 'strValue2 = strValue4 Next 'msgbox strValue3(1) 'msgbox strValue4(1) if strValue1(0) = "160" then strCMD1 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:H_DISABLE" else strCMD1 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:V_DISABLE" End if
if strValue1(0) = "160" and strValue2(0) = "160" and strValue3(1) = "11" then 'msgbox "Display 1 and Display are Horizontal and Digital is primary" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:HH" end if if strValue1(0) = "160" and strValue2(0) = "160" and strValue3(1) = "1" then 'msgbox "Display 1 and Display are Horizontal and Monitor is primary" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:HH2" end if
if strValue1(0) = "132" and strValue2(0) = "160" then 'msgbox "Display 1 is Vertical Display 2 is Horizontal" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:VH" end if if strValue1(0) = "160" and strValue2(0) = "132" then 'msgbox "Display 1 is Horizontal and Display 2 is Vertical" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:HV" end if
if strValue1(0) = "132" and strValue2(0) = "132" and strValue3(1) = "11" then 'msgbox "Display 1 and Display 2 are Vertical and Digital is primary" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:VV" end if if strValue1(0) = "132" and strValue2(0) = "132" and strValue3(1) = "1" then 'msgbox "Display 1 and Display 2 are Vertical and Monitor is primary" strCMD3 = chr(34)&"C:\Windows\system32\igfxcfg.exe"&chr(34)&" /SchemeName:VV2" end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent" objShell.Run strCMD1,0, True WScript.Sleep 1000 objShell.Run strCMD2,0, True WScript.Sleep 1000 objShell.Run strCMD3,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Dell Inc. Latitude D610" then strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent" objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Dell Inc. Latitude D620" then strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent" objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Dell Inc. Latitude D630" then strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent" objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Dell Inc. OptiPlex 745" then 'msgbox MakeModel strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" /accepteula "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& chr(34)&"/timer:0 /nolicprompt /silent /all"&chr(34) objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel = "Dell Inc. OptiPlex 755" then 'msgbox MakeModel strCMD1 = chr(34)&"C:\Program Files\BGInfo\BGInfo_Fix.exe"&chr(34)&"toggle_onoff" strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" /accepteula "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& chr(34)&"/timer:0 /nolicprompt /silent /all"&chr(34) objShell.Run strCMD1,0, True objShell.Run strCMD2,0, True objShell.Run strCMD1,0, True Wscript.Quit end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If MakeModel <> "Hewlett-Packard HP Compaq dc7900 Small Form Factor" then strCMD2 = chr(34)&"C:\Program Files\BGInfo\Bginfo.exe"&chr(34)&" "& chr(34)&"C:\Program Files\BGInfo\bginfo.bgi"&chr(34)&" "& "/timer:0 /nolicprompt /silent" objShell.Run strCMD2,0, True Wscript.Quit end if
|
|
Δ Server 2008 Create 1000 Accounts
How do you create 1000 test user accounts in Server 2008 AD?
Objective |
Create 1000 Users Accounts in Server 2008 |
on error resume next
For i = 1 To 1000 Set objRootDSE = GetObject("LDAP://rootDSE") Set objContainer = GetObject("LDAP://cn=Users," & objRootDSE.Get("defaultNamingContext")) Set objUser = objContainer.Create("User", "cn=User" & i) objUser.Put "sAMAccountName","User" &
i objUser.SetPassword "welcome99" objUser.Put "givenName", "User" objUser.Put "initials", "U." objUser.Put "sn",
i objUser.Put "displayName"&","&i&",User" objUser.Put "physicalDeliveryOfficeName", "Room 4358-"&i objUser.Put "telephoneNumber", "(800) 555-1234 ext."&i objUser.Put "mail", "User"&i&"@blackops.net" objUser.Put "wWWHomePage",
"http://www.blackops.net" objUser.Put "description", "Description of User"&i
objUser.Put "userPrincipalName", "User"&i&"@section1.blackops.net" objUser.Put "profilePath",
"\\blackops\Profiles\"&"User"&i objUser.Put "scriptPath", "logon.bat" objUser.Put "homeDirectory",
"\\blackops\HomeFolders\"&"User"&i objUser.Put "homeDrive", "X"
objUser.IsAccountLocked = False objUser.Put "streetAddress", "Building 9" & vbCrLf & "BlackOps Tower" objUser.Put "l", "Secure Site" objUser.Put "st", "Unknown" objUser.Put "postalCode", "xxxxxx" objUser.Put "c", "US" objUser.Put "postOfficeBox", "2222"
'objUser.Put "userWorkstations", "wks1,wks2,wks3" 'objUser.AccountExpirationDate = "03/30/2003"
objUser.SetInfo Next
|
|
Δ
SurveyMonkey.com Data Collection
How do you collect hidden data from
a survey?
Objective |
Collect hidden data on a computer through survey monkey |
On error resume next Dim fso, tempfile, tfolder, tname, tfile, surveyLink Dim IP_Address : IP_Address = GetIP()
Function GetIP() Dim ws : Set ws = CreateObject("WScript.Shell") Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") Dim TmpFile : TmpFile = fso.GetSpecialFolder(2) & "/ip.txt" Dim ThisLine, IP If ws.Environment("SYSTEM")("OS") = "" Then ws.run "winipcfg /batch " & TmpFile, 0, True Else ws.run "%comspec% /c ipconfig > " & TmpFile, 0, True End If With fso.GetFile(TmpFile).OpenAsTextStream Do While NOT .AtEndOfStream ThisLine = .ReadLine If InStr(ThisLine, "Address") <> 0 Then IP = Mid(ThisLine, InStr(ThisLine, ":") + 2) Loop .Close End With 'WinXP (NT? 2K?) leaves a carriage return at the end of line If IP <> "" Then If Asc(Right(IP, 1)) = 13 Then IP = Left(IP, Len(IP) - 1) End If GetIP = IP fso.GetFile(TmpFile).Delete Set fso = Nothing Set ws = Nothing End Function
strComputer ="." Set wmiService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set wmiResults = wmiService.ExecQuery("SELECT * FROM Win32_ComputerSystem") For Each item In wmiResults model = item.Model Next
Set wmiService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set wmiResults = wmiService.ExecQuery("SELECT * FROM Win32_bios") For Each item In wmiResults sn = item.serialNumber Next
surveyLink = " http://www.surveymonkey.com/s/XXXXXX?c=%computername%_%username%_"&model&"_"&sn&"_"&IP_Address
Set objShell = CreateObject("Wscript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Const TemporaryFolder =
2 Set tfolder = fso.GetSpecialFolder(TemporaryFolder) tname =
"surveymonkey.cmd"
Set tfile = tfolder.CreateTextFile(tname) Set CreateTempFile = tfile Set tempfile = CreateTempFile
tempfile.WriteLine ":MONITOR" tempfile.WriteLine "TASKLIST /v /FI "&chr(34)&"WINDOWTITLE ne zzz"&chr(34)&" | find /i "&chr(34)&"SurveyMonkey.com - Powerful tool for"&chr(34) & " && TASKKILL /fi " & chr(34)&"WINDOWTITLE eq SurveyMonkey.com*"&chr(34)&" && Exit" tempfile.WriteLine "goto MONITOR" tempfile.Close
iexplore = Chr(34)&"C:\Program Files\Internet Explorer\iexplore.exe"&Chr(34) objShell.Run iexplore & surveyLink,9,False objShell.Run tfolder & "\" & tname, False
|
|
|
|
..About
..I'm a Computer ..Systems Engineer
..Living and loving life ........................................
..Author
....
|