can anybody help with some WScript as I am completely new to this.
I am working in an intranet environment and basically need to do the following:
1: Access the computer name of a user, who is calling an asp page
2: Get the active printer of that user and change it's settings
3: Print out an asp page with the new printer settings
can this be done?
I have played around a bit with WScript, but can't seem to get the computer name of the user (or it always returns the server name, where the asp script is run at) and when I try to run the following code I get the error message "Error Type:(0x80041003)", it errors on GetObject(), which I think means I don't have permission to do the following:
function TranslateDomainRole(byVal roleID)
Select Case roleID
a = "Standalone Workstation"
a = "Member Workstation"
a = "Standalone Server"
a = "Member Server"
a = "Backup Domain Controller"
a = "Primary Domain Controller"
TranslateDomainRole = a
Dim s, System, item
Set System = GetObject("winmgmts:").instancesOf("Win32_Computer System")
for each item in system'
s = "Computer Info" & vbcrlf
s = s & "***********************" & vbcrlf
s = s & "Name: " & item.name & vbcrlf
s = s & "Status: " & item.status & vbcrlf
s = s & "Type: " & item.SystemType & vbcrlf
s = s & "Mfg: " & item.Manufacturer & vbcrlf
s = s & "Model: " & item.Model & vbcrlf
s = s & "RAM: ~" & item.TotalPhysicalMemory\1024000 & "mb" & vbcrlf
s = s & "Domain: " & item.Domain & vbcrlf
s = s & "Role: " & TranslateDomainRole(item.DomainRole) & vbcrlf
s = s & "Current User: " & item.UserName & vbcrlf
any help is greatly appreciated...