Showing posts with label Scripting. Show all posts
Showing posts with label Scripting. Show all posts

Monday, October 15, 2012

List domain user's folder access permissions

Download to tool from link.  Install it to your computer,

Go to the folder that you install subinacl from command prompt and execute the command.


subinacl /testmode /noverbose /outputlog=c:\permission.TXT /subdirectories=directoriesonly h:\*.* /findsid=domain\username
Read more...

Monday, February 7, 2011

Add User to Group

Command will add user1 to local administrators group.

net localgroup "Administrators" "domain\user1" /add
Read more...

Enable Local User

net user user1 Password /active:yes
Read more...

Enable DHCP VB Script (WMI)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableDHCP()
Next
Read more...

Disable CDROM VB Script

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Services\Cdrom"
strValueName = "Start"
dwValue = 4
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
Read more...

Disable USB Storage VB Script

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
'Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services\USBSTOR"
strValueName = "Start"
dwValue = 4
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

Use dwValue = 3 for enable
Read more...

Remove From Local Administrators VBS Script

Script will remove the users from Local Administrators group except which are stated in script.Username must be in CAPITAL letter.

Script

Option Explicit
Dim network, group, user
Set network = CreateObject("WScript.Network")
Set group = GetObject("WinNT://" & network.ComputerName & "/Administrators,group")
For Each user In group.members
If UCase(user.name) <> "user1" And UCase(user.name) <> "user2" And UCase(user.name) <> "user3" And UCase(user.name) <> "user4" And UCase(user.name) <> "user5" And UCase(user.name) <> "user6" Then
group.remove user.adspath
End If
Next
Read more...
 
span.fullpost {display:none;}