November 2008 - Posts

VBS Script To Send Active Directory System Management Container Information To Excel

 

This VBS script will allow you to send your Active Directory (AD) System System Management Container information to excel for your documentation and refrence.

 

Note: Other system containers such as your File Replication Service, IP Security and MicrosoftDNS containers can be accessed as well by changing the strContainer value from  CN=System Management to CN=IP Security for example.

 

VBS Script:

 

strContainer = "CN=System Management,CN=System,"

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "Name"

objExcel.Cells(1, 2).Value = "Type"

objExcel.Cells(1, 3).Value = "Description"

 

Set objDomain = GetObject("LDAP://RootDSE")

Set objContainer = GetObject("LDAP://" & strContainer & objDomain.Get("defaultNamingContext"))

 

For Each objChild In objContainer

Set objClass = GetObject(objChild.Schema)

If objClass.Container = True Then

objExcel.Cells(intRow, 1).Value = objChild.Name

objExcel.Cells(intRow, 2).Value = objChild.Class

objExcel.Cells(intRow, 3).Value = objChild.Description

Else

objExcel.Cells(intRow, 1).Value = objChild.Name

objExcel.Cells(intRow, 2).Value = objChild.Class

objExcel.Cells(intRow, 3).Value = objChild.Description

End If

intRow = intRow + 1

Next

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Range("A1").Select

objExcel.Cells.EntireColumn.AutoFit

 

Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

Set objRange = objExcel.Range("A1")

objRange.Sort objRange,1,,,,,,1

 

MsgBox "Done"

 

 

Posted by dhite | with no comments
Filed under:

Asset Intelligence Asset Intelligence Reports VBS Script

 

Provided here is a VBS script version of the Asset Intelligence asset intelligence reports report.

 

VBS Script:

 

strComputer = InputBox ("Enter Site Server Name")

strSiteCode = InputBox ("Enter Site Code")

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "Name"

objExcel.Cells(1, 2).Value = "Category"

objExcel.Cells(1, 3).Value = "Report ID"

 

Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)

Set colItems = objWMIService.ExecQuery("Select * from SMS_Report Where Category = 'Asset Intelligence'")

For Each objItem in colItems

objExcel.Cells(intRow, 1).Value = objItem.Name

objExcel.Cells(intRow, 2).Value = objItem.Category

objExcel.Cells(intRow, 3).Value = objItem.ReportID

intRow = intRow + 1

Next

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Interior.ColorIndex = 19

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"

 

 

 

Posted by dhite | with no comments
Filed under:

Inventoried Software Titles All Inventoried Software Titles SQL Query

 

Provided here is a SQL version of the Asset Intelligence inventoried software titles all inventoried software titles report.

 

SQL Query:

 

Select

CommonName 'Product Name',

IsNull(CommonPublisher, '') Vendor,

IsNull(CommonVersion, '') Version,

CategoryName Category,

FamilyName 'Family Name',

IsNull(Tag1Name, '') 'Label 1',

IsNull(Tag2Name, '') 'Label 2',

IsNull(Tag3Name, '') 'Label 3',

'State' = Case

When State = 4 Then 'Uncategorized'

Else 'Validated'

End

 

From v_LU_SoftwareList_Editable 

Order by CommonName

 

 

Posted by dhite | with no comments
Filed under:

Asset Intelligence Customized Catalog Software Families SQL Query

 

Provided here is a SQL version of the Asset Intelligence customized catalog software families report.

 

SQL Query:

 

Select

CategoryName Name,

Description,

'Type' = Case

When Type = 1 Then 'Validated'

End

 

From v_LU_Category_Editable

Where Type = 1

Order by CategoryName

 

 

Posted by dhite | with no comments
Filed under:

In Like Flynn

 

Errol Flynn was quite the ladies man according to the newspapers and tabloids of his day. During World War II servicemen fist coined “In like Flynn” when they were bragging about their own conquests or to it was used to describe someone with those gifts that they envied.

 

Today we use the term to do the same as they did back in the 1940’s.

 

 

Posted by dhite | 5 comment(s)
Filed under:

Free IntelliAdmin RDP Remote Desktop Enabler Download

 

This free Remote Desktop Enabler utility from IntelliAdmin allows to you enable the remote desktop feature of Windows XP and later machines remotely. The utility is useful for enabling Remote Desktop on machines where you forgot to enable connectivity and cannot get the machines physically.

 

RDP Remote Desktop Enabler

http://www.intelliadmin.com/RDPRemoteEnabler_Free.exe

 

Screen Print

http://www.mydigitallife.info/wp-content/uploads/2008/06/remote-desktop-enabler-268x300.jpg

 

 

Posted by dhite | with no comments
Filed under: ,

Remote Desktop Chooser HTA Script

 

Provided here is an HTA script that will allow you to start a Remote Desktop connection to a specified machine by selecting or choosing the machine name from a list of radio boxes.

 

Note: This script only uses the Full Screen (/F) switch however you can use any of the other following switches in its place or in addition to it:

 

“Connection File”

/Console

/Admin

/W:xxx

/H:xxx

/Public

/Span

/Edit

/Migrate

 

For a complete list of available remote desktop connection usage switches from the Run line enter: Mstsc /?

 

Tip: On the line(s) that read:

<input type="radio" name="RadioOption" value="ServerOne">Server One<BR>

You can change the value="ServerOne" to the machines IP address if needed or you can change the Server One machine name value to a more descriptive name such as in the example below:

<input type="radio" name="RadioOption" value="SMS001">Primary<BR>

<input type="radio" name="RadioOption" value="SMS002">Secondary<BR>

 

HTA Script:

 

<Html>

<Head>

<Title>Remote Desktop Chooser</Title>

<Style>

Body {Background-Color: CornSilk}

</Style>

 

<HTA:Application

Caption = Yes

Border = Thick

Scroll = No

ShowInTaskBar = No

MaximizeButton = Yes

MinimizeButton = Yes>

 

<script Language = VBScript>

Sub Window_OnLoad

Window.ResizeTo 400,250

End Sub

 

Sub WindowsLoad

For Each objButton in RadioOption

If objButton.Checked Then

Set wshShell = CreateObject("WScript.Shell")

WshShell.Run "Mstsc /V " & objButton.Value & " /F"

End If

Next

Self.Close()

End Sub

 

</script><Body>

<p><h3 align = center><font color='Orange'>Please Visit myITforum.Com</font></h3>

<div></div>

<table align='center'>

<input type="radio" name="RadioOption" value="ServerOne">Server One<BR>

<input type="radio" name="RadioOption" value="ServerTwo">Server Two<BR>

<input type="radio" name="RadioOption" value="ServerThree">Server Three<P>

<input id=runbutton  class="button" type="button" value="Run Script" name="run_button"  onClick="WindowsLoad">

<Span Id = "DataArea"></Span></Body><Div Align = "Center">

<P><A Href="http://myitforum.com/cs2/blogs/dhite">Created For myITforum By Don Hite</A>

 

 

 

Posted by dhite | 1 comment(s)
Filed under:

By Request VBS Script To Run A Local Executable

 

This By Request VBS script will start the Hearts Game form a Local machine.

 

VBS Script:

 

Set objShell = createobject("wscript.shell")

strCommand = "MsHearts.Exe"

objShell.run strCommand, 1, True

 

 

Posted by dhite | with no comments
Filed under:

Weird Facts And Wacky Usages

 

Learn the weird histories and bizarre facts behind these products.

http://www.wackyuses.com/weird.html

 

Discover hundreds of little-known uses for well-known products,

by just clicking on a product!

http://www.wackyuses.com/uses.html

 

 

Posted by dhite | with no comments
Filed under:

How

 

  • How can something be "new" and "improved"? Was it “old” and “crappy” before?
  • How come all of the planets are round?
  • How come cat’s rear ends go up when you pet them?
  • How come lemon washing up liquid contains real lemons, but lemon juice contains artificial flavoring?
  • How come toy hippos are always blue, or purple, when real hippos are brown?
  • How come you can kill a deer and put it up on your wall but it's illegal to keep one as a pet?
  • How come you never see a billboard being put up by the highway?
  • How do you handcuff a one-armed man?
  • How do you tell when you run out of invisible ink?
  • How does a Real Estate company sell its office without causing confusion?
  • How does Freddy Kruger wipe his nose?
  • How far east can you go before you're heading west?
  • How fast do hotcakes sell?
  • How important does a person have to be before they are considered assassinated instead of just murdered?

 

Posted by dhite | with no comments
Filed under:

VBS Script To Determine If Machines Are Clients And Send The Results To Excel

 

This VBS Script will allow you to enter a site server name and site code and will write all of the resource names found to an Excel spreadsheet and if the resources are not clients the results will be written in red.

 

VBS Script:

 

strComputer = InputBox ("Enter Site Server Name")

strSiteCode = InputBox ("Enter Site Code")

 

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 = "Client"

 

Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)

Set colItems = objWMIService.ExecQuery ("Select * From SMS_R_System")

For Each objItem in colItems

 

objExcel.Cells(intRow, 1).Value = objItem.Name

If objItem.Client = 1 Then

objExcel.Cells(intRow, 2).Value = "Yes"

Else

objExcel.Cells(intRow, 2).Value = "No"

End If

 

If objExcel.Cells(intRow, 2).Value = "No" Then

objExcel.Cells(intRow, 1).Font.ColorIndex = 3

objExcel.Cells(intRow, 2).Font.ColorIndex = 3

End If

intRow = intRow + 1

Next

 

objExcel.Range("A1:B1").Select

objExcel.Selection.Interior.ColorIndex = 19

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"

 

 

 

Posted by dhite | with no comments
Filed under:

Vbs Script To Get A Machines Parent Organizational Unit

 

This Vbs script will prompt you for a machine name and then return the parent Organizational Unit (OU) that it belongs to.

 

Note: Be sure to change Your_DC_Name to your DC name in the line that reads:

 

'LDAP://dc=Your_Dc_Name,dc=com' WHERE objectCategory = 'computer' " _

 

Vbs Script:

 

Const ADS_SCOPE_SUBTREE = 2

 

strComputer = InputBox("Enter Machine Name")

 

Set objConnection = CreateObject("ADODB.Connection")

Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"

objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection

 

objCommand.Properties("Page Size") = 1000

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

 

On Error Resume Next

objCommand.CommandText = "Select ADsPath From 'LDAP://dc=Your_Dc_Name,dc=com' WHERE objectCategory = 'computer' " _

& "AND name='" & strcomputer & "'"

Set objRecordSet = objCommand.Execute

 

objRecordSet.MoveFirst

 

Do Until objRecordSet.EOF

strResult = objRecordSet.Fields("ADsPath").Value

objRecordSet.MoveNext

Loop

 

If strResult <> "" Then

Wscript.Echo "The Parent OU For " & UCase(strComputer) & " is: " & strResult

Else

Wscript.Echo "The Machine Was Not Found"

End If

 

 

 

Posted by dhite | with no comments
Filed under:

VBS Script To Count Files In A Specified Site Servers Specified InBox

 

This VBS script will prompt you for a site server name, site code and inbox and will count the files in the specified inbox and send the results to an Excel spreadsheet.

 

VBS Script:

 

strSiteServer = InputBox ("Enter Site Server Name")

strSiteCode = InputBox ("Enter Site Code")

strInbox = InputBox ("Enter InBox Name",, "CcrRetry.Box")

 

objGetPath = "\\" & strSiteServer & "\SMS_" & strSiteCode & "\Inboxes\" & strInbox

 

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "Site Server"

objExcel.Cells(1, 2).Value = "Site Code"

objExcel.Cells(1, 3).Value = UCase(strInbox) & " Count"

ListFolders(objGetPath)

 

Sub ListFolders(sPath)

Set oFolder = oFSO.GetFolder(sPath)

objExcel.Cells(intRow, 1).Value = UCase(strSiteServer)

objExcel.Cells(intRow, 2).Value = UCase(strSiteCode)

If objExcel.Cells(intRow, 3).Value = "" Then

objExcel.Cells(intRow, 3).Value = "None"

Else

objExcel.Cells(intRow, 3).Value = oFolder.Files.Count

End If

intRow = intRow + 1

 

For Each oFldr In oFolder.SubFolders

ListFolders oFldr.Path

Next

End Sub

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

 

 

Posted by dhite | with no comments
Filed under:

SQL Query To Return Your SQL Servers Property Information

 

This SQL Query will allow you to retrieve Property information about your SQL server.

 

SQL Query:

 

Select

ServerProperty('ServerName') 'Server Name',

ServerProperty('ComputerNamePhysicalNetBIOS') 'Physical Machine',

 

'Instance Name' = Case

When ServerProperty('InstanceName') Is NULL Then ''

Else '<Unknown>'

End,

 

ServerProperty('Edition') 'Edition',

ServerProperty('ProductLevel') 'Product Level',

ServerProperty('ProductVersion') 'Product Version',

 

'Clustered' = Case

When ServerProperty('IsClustered') = 0 Then 'No'

When ServerProperty('IsClustered') = 1 Then 'Yes'

Else '<Unknown>'

End,

 

'Integrated Security' = Case

When ServerProperty('IsIntegratedSecurityOnly') = 0 Then 'No'

When ServerProperty('IsIntegratedSecurityOnly') = 1 Then 'Yes'

Else '<Unknown>'

End,

 

'Single User Mode' = Case

When ServerProperty('IsSingleUser') = 0 Then 'No'

When ServerProperty('IsSingleUser') = 1 Then 'Yes'

Else '<Unknown>'

End,

 

'Number Of Licenses' = Case

When ServerProperty('NumLicenses') Is NULL Then ''

Else '<Unknown>'

End,

 

ServerProperty('LicenseType') 'LicenseType'

 

 

Posted by dhite | with no comments
Filed under:

The Home Folder Was Not Created Windows 2003 Server Error

 

If you receive an error similar to the one below when attempting to setup domain users home shares the issue is a permissions problem:

 

The home folder was not created because you do not have create access on the server. The user account has been updated with the new home folder value but you must create the directory manually after obtaining the required access rights.

 

To resolve the issue at the root share you must grant the Administrators or Domain Admins full control permissions to the root folder.

 

If you have the following directory folder: X:\Users you must grant the Domain Admins full control (NTFS) permissions to the folder (The folder is not shared). Then you can setup your user’s home shares without receiving the error above. 

 

 

Posted by dhite | with no comments
Filed under:
More Posts Next page »