Free for PREMIUM members
[Webinar] Streamline your web hosting managementRegister Today
'create an instance of the Wscript Network object; using the (2) objects
Set objNetwork = CreateObject("Wscript.Network")
'set your strings
strComputer = objNetwork.ComputerName
strUser = objNetwork.UserName
'set variables for the write process
Dim Filesys, WriteFiletxt
Set Filesys = CreateObject("Scripting.FileSystemObject")
Set WriteFiletxt = Filesys.CreateTextFile("c:\local-admin.txt", false)
'use the WinNT provider to bind to the Administrators group on the computer in question
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
'set up For Each loop to walk through the group membership
For Each objUser in objGroup.Members
If objUser.Name = strUser Then
'Write output to the text file listed above
WriteFiletxt.WriteLine strUser & " Has Administrator Rights. "
Open in new window
GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $159.20.
Premium members get this course for $62.50.
Premium members get this course for $122.40.
Premium members get this course for $37.50.
Premium members get this course for $349.00.
Premium members get this course for $79.20.