This VBS script will take a ConfigMgr 2007 or SMS 2003 site server name and site code from input dialog boxes and will write all of the machines that have a specified product installed to an excel spreadsheet sorted alphabetically by machine name.
Note: Change the strProductName = "Microsoft .NET Framework 3.0" to reflect the Product name you wish to query for.
VBS Script:
strServer = InputBox ("Enter Site Server Name")
strDatabase = InputBox ("Enter Three Letter Site Code")
strProductName = "Microsoft .NET Framework 3.0"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "User Name"
objExcel.Cells(1, 3).Value = "Product Name"
objExcel.Cells(1, 4).Value = "Product Version"
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=SQLOLEDB;Data Source =" & strServer & ";" & _
"Trusted_Connection=Yes;Initial Catalog =SMS_" & strDatabase
Set objRecordSet = CreateObject("ADODB.Recordset")
objRecordSet.Open _
" Select SD.Name0, SD.User_Name0, SP.ProductName, SP.ProductVersion" & _
" From vSMS_G_System_SoftwareProduct SP" & _
" Join System_Disc SD on SD.ItemKey = SP.ClientId" & _
" Where SP.ProductName = '" & strProductName & "' " _
, objConnection, adOpenStatic, adLockOptimistic
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
objExcel.Cells(intRow, 1).Value = objRecordSet.Fields("Name0").Value
objExcel.Cells(intRow, 2).Value = objRecordSet.Fields("User_Name0").Value
objExcel.Cells(intRow, 3).Value = objRecordSet.Fields("ProductName").Value
objExcel.Cells(intRow, 4).Value = objRecordSet.Fields("ProductVersion").Value
objRecordSet.MoveNext
intRow = intRow + 1
Loop
objExcel.Range("A1:D1").Select
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objExcel.Range("A1")
objRange.Sort objRange,1,,,,,,1
MsgBox "Done"
This is a VBS script that I wrote to allow me enumerate the MP3 files in my Windows Media Player C:\Documents and Settings\Don\My Documents\My Music folder.
The script will send the following information to an excel spreadsheet: Track, Title, Artist, Album, Size and Length.
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder (0, "Select Media Folder:", (0))
If objFolder Is Nothing Then
Wscript.Quit
Else
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
End If
objExcel.Cells(1, 1).Value = "Track"
objExcel.Cells(1, 2).Value = "Title"
objExcel.Cells(1, 3).Value = "Artist"
objExcel.Cells(1, 4).Value = "Album"
objExcel.Cells(1, 5).Value = "Size"
objExcel.Cells(1, 6).Value = "Length"
Set objShell = CreateObject ("Shell.Application")
For Each strFileName in objFolder.Items
objExcel.Cells(intRow, 1).Value = objFolder.GetDetailsOf(strFileName, 20) 'Track
objExcel.Cells(intRow, 2).Value = objFolder.GetDetailsOf(strFileName, 0) 'Title
objExcel.Cells(intRow, 3).Value = objFolder.GetDetailsOf(strFileName, 10) 'Artist
objExcel.Cells(intRow, 4).Value = objFolder.GetDetailsOf(strFileName, 18) 'Ablum
objExcel.Cells(intRow, 5).Value = objFolder.GetDetailsOf(strFileName, 8) 'Size
objExcel.Cells(intRow, 6).Value = objFolder.GetDetailsOf(strFileName, 22) 'Length
Next
objExcel.Range("A1:F1").Select
objExcel.Selection.Interior.ColorIndex = 19
This SQL Query will list all of the collections on the site server from which the query is executed on and will write the collection ID, Collection Name and the time stamp for when the collection was last updated.
SQL Query:
Select
CC.CollectionID,
CN.CollectionName,
Convert(VarChar(10), CC.TimeUpdated, 101) 'Last Updated'
From Collection_MemberChg_Notif CC
Join Collections CN on CC.CollectionID = CN.SiteID
Order By CollectionName
This SQL Query will retrieve the machine names from a specified collection.
Members.Name
'Collection Members:'
From CollectionMembers Members
Join Collections Coll on Members.SiteID = Coll.SiteID
Where Coll.CollectionName = 'All Systems'
To see a list of all the available Collections use this query and then change the 'All Systems' collection name as needed:
Select CollectionName From Collections
When you install Windows server 2008 and attempt to connect to it via Remote Desktop from a Windows XP machine the connection may fail yet you can successfully connect to it from a Windows Vista machine.
This is because the configured option is set to use “Network Level Authentication” and since it is more secure you will not be able to connect to the server from a Windows XP machine.
Follow the steps below to initially set up your servers Remote Desktop to allow Windows XP machines to connect and manage it.
1. Open the Server Manager.
2. At the Server Summary task pane select “Configure Remote Desktop”.
3. From the Systems Properties dialog box in the “Remote Desktop” leaf select “Allow connections from computers running any version of one of Remote Desktop (Less secure)”
4. Select “OK” to set the changes and close the Server Manager.
Note: Windows XP uses Remote Desktop Connection 5.x and Vista uses 6.x with Network Level Authentication (NLA).
In the early days of the railroad a single track was laid from one point to the other until it finally reached across the United States linking the North, South, East and West together. In case two trains happened to be heading in opposite directions on the same track the problem was alleviated by creating short pieces of railroad track called sidings. The sidings allowed one train to ‘pull over’ onto the siding or side track to wait for the other train to pass. So one train was side tracked to let the other pass.
Today we use the term Sidetracked to imply that we have deviated from a main issue or course or have been delayed.
Internet Information Services (IIS) 7.0 Manager is an administration User Interface (UI) that provides users and administrators with a way to remotely manage IIS 7.0 Windows 2008 Server servers.
The download allows you to manage multiple IIS 7.0 servers remotely as a standalone install meaning that you do not have to have and IIS server on your client system to use the application.
Supported Operating Systems:
Windows Server 2003 Service Pack 1
Windows Vista Service Pack 1
Windows XP Service Pack 2
Note: You must have the Microsoft .NET Framework version 2.0 or greater installed.
IinetMgr Download:
http://www.microsoft.com/DownLoads/details.aspx?familyid=32C54C37-7530-4FC0-BD20-177A3E5330B7&displaylang=en
Please stop by and welcome Roger Zander to myITforum. Roger is the creator of many great SMS and Configuration Manager utilities designed to ease the burdens of admins in the field including the following:
Screen Lock
Secure Autologon
SMS 2003 Adv.Client local policy import
SMS 2003 Offline Hardware Inventory
SMS 2003 Software Request Web Form
SMS Client Center
SMS Client Center Web GUI
SMS CloneDP
SMS Collection Commander
SMS OSD Program Import
SMS Package Dependency Viewer
SMS Site Settings tweak
SMS/SCCM Peer2Peer AddOn
SMS2003 Object Backup
Roger Zander Sourceforge Tools And Utilities
http://myitforum.com/cs2/blogs/dhite/archive/2008/01/15/roger-zander-sourceforge-tools-and-utilities.aspx
Roger Zander At myITforum
http://myitforum.com/cs2/blogs/rzander/default.aspx
Drop by Jason Sandys new myITforum Blog page where he will be migrating some of his previous posts from his http://ihaveablog.wordpress.com Blog page.
Jason has written some great post on the following: Active Directory, Administration, Configuration Manager, Exchange, Hyper-V, Office, Operations Manager, Security, Server 2008 and SQL Server. He is also actively helping folks in the myITforum Forums
I Have A Blog, And I Must Scream:
http://myitforum.com/cs2/blogs/jsandys/default.aspx
Here you will find examples of how to create Configuration Manager <unspecified> Console WQL queries to return users full names as well as their Login ID name.
All Users And All Machines
S.Name,
U.UserName,
U.FullUserName
From SMS_R_System S, SMS_R_User U
Where S.LastLogonUserName = U.UserName
Prompts For Full Name
And FullUserName = ##PRM:SMS_R_User.FullUserName##
Prompts For Logon Name
And UserName = ##PRM:SMS_R_User.UserName##
Prompts For Machine Name
And Name = ##PRM:SMS_R_System.Name##
This VBS Script will take a ConfigMgr 2007 or SMS 2003 site server name and site code from input dialog boxes and write the All Systems with Hardware Inventory Collected information to an excel spreadsheet sorted alphabetically.
objExcel.Cells(1, 2).Value = "Domain"
objExcel.Cells(1, 3).Value = "Time Stamp"
" Select Disc.Name0, Data.Domain0, Data.TimeKey" & _
" From System_Disc Disc" & _
" Join System_Data Data on Data.MachineID = Disc.ItemKey" _
objExcel.Cells(intRow, 2).Value = objRecordSet.Fields("Domain0").Value
objExcel.Cells(intRow, 3).Value = objRecordSet.Fields("TimeKey").Value
objExcel.Range("A1:C1").Select
This VBS Script will allow you to determine if a specified user is a member of a specified domain group.
strDomain = InputBox ("Enter Domain Name")
strGroup = InputBox ("Enter Group Name")
strUser = InputBox ("Enter User Name")
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",User")
Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",Group")
If objGroup.IsMember(objUser.AdsPath) Then
MsgBox UCase(strUser) & " Is A Member Of " & UCase(StrDomain) & "\" & UCase(strGroup)
MsgBox UCase(strUser) & " Is A Not Member Of " & UCase(StrDomain) & "\" & UCase(strGroup)
This VBS script will allow you to send the members of a hard coded NT or Active Directory (AD) domain to an excel spreadsheet.
strGroup = "GroupName"
objExcel.Cells(1, 1).Value = "User Name"
Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup)
Set strMembers = objGroup.Members
For Each strMember In strMembers
objExcel.Cells(intRow, 1).Value = strMember.Name
objExcel.Range("A1").Select
This SQL query will return the following information from a specified Organizational Unit (OU): Machine name, User Name, Full name, Users OU and its Subnet.
Select Distinct
CS.Name0 'Machine Name',
CS.UserName0 'User Name',
RU.Full_User_Name0 'Full Name',
UOU.User_OU_Name0 'Users OU',
RA.IP_Subnets0 'Subnet'
From v_Gs_Computer_System CS
Join v_RA_System_IPSubnets RA on RA.ResourceID = CS.ResourceID
Join v_R_User RU on RU.Unique_User_Name0 = CS.UserName0
Join v_RA_User_UserOUName UOU on UOU.ResourceID = RU.ResourceID
Where UOU.User_OU_Name0 = 'DomainName.COM/OuName'
Order by CS.Name0, CS.Username0, RU.Full_User_Name0, RA.IP_Subnets0
Thanks To Janis K for the suggestion.