Basic output
Basic input
V = InputBox("What the heck?")
Getting if user belonged to specified group
Set oNetwork = CreateObject("WScript.Network")
sDomain = oNetwork.UserDomain
sUser = oNetwork.UserName
bIsMember = False
Set oUser = GetObject("WinNT://" & sDomain & "/" & _
sUser & ",user")
For Each oGroup In userObj.Groups
If oGroup.Name = "Domain Users" Then
bIsMember = True
Exit For
End If
Next
Mapping
Set oNet = WScript.CreateObject("WScript.Network")
oNet.MapNetworkDrive "X:", "\\theServer\XFiles)
Set oNet = WScript.CreateObject("WScript.Network")
oNet.AddWindowsPrinterConnection "\\PrintServer\SecretPrinter"
oNet.SetDefaultPrinter "\\PrintServer\SecretPrinter"
Getting IP address
Set myObj = GetObject("winmgmts:{impersonationLevel=impersonate}" & _
"!//localhost".ExecQuery_
("select IPAddress from " & _
"Win32_NetworkingAdapterConfiguration" & _" where IPEnabled=TRUE")
'Go through the addresses
For Each IPAddress in myObj
If IPAddress.IPAddress(0) <> "0.0.0.0" Then
LocalIP = IPAddress.IPAddress(0)
Exit For
End If
Next