Archive

Archive for the ‘Tips’ Category

The attempt to connect to http://servername.domain.com/PowerShell using Kerberos authentication failed

“The attempt to connect to http://ExchangeServer.domain.com/PowerShell using “Kerberos” authentication failed: connecting to remote server failed with the following error message : The WinRM client cannot complete the operation within the time specified.  Check if the machine name is valid and is reachable over the network and firewall exception for Windows Remote Management service is enabled.  For more information, see the about_Remote_Troubleshooting Help topic.”

You might notice above error message after opening a Exchange Management Console. This error message indicates that connecting to given exchange server using WinRM has failed. Today I received the same error and verified that exchange is doing well on this box. I tried opening the console from different server and it worked file. So, it appeared some sort of profile problem to me.

I did the following to resolve the issue.

  1. Close Exchange Management Console MMC
  2. Go to %appdata%\Microsoft\MMC
  3. Rename “Exchange Management Console” file to “Exchange Management Console.old”
  4. Launch the console again.

Hope this helps…

Use https for safe tweeting

November 30, 2011 Leave a comment

Hello Readers,
How many of you regularly use twitter? I guess most of you. Have ever worried about the security it is providing? You should read on if your answer is NO.

One of colleagues gave a quick demo a few days back to show how insecure the default twitter is. His demo proved that, any one sitting in same network as yours can easily hijack your twitter account and tweet on behalf of you. He was able to make it because twitter runs on http by default. Since it is http, all the data transfer will happen over wire in plain text format. So, any one in your network with a couple of  tools can spoof your MAC address can easily capture what you are sending over wire and get the twitter cookie(key for maintaining your twitter session) and tweet using your twitter account. The method that my colleague demonstrated is a simple hack any one with computer knowledge can execute it.

How to I make it secure:  Twitter provides a option to make your twitter account to use https(secure http) as default protocol. Making use of this will at least prevent your twitter account from this kind of silly hacks.

You can follow the below procedure to enable the https

  • Logon to twitter account.
  • Go to your profile tab and click on edit profile
  • Go to Account section in your profile and check the box Always use HTTPS
  • Click on Save and enter your password when prompted

  • Now your twitter account is secured.
Categories: Sysadmin, Tips

PowerShell: Quick and easy to start stop a remote service

November 22, 2011 3 comments

Do you like one liners in powershell? Here is the quick and easy way to start, stop, restart a service on remote computer. This doesn’t require PowerShell remoting. That means you can use it against any computer which has windows operating system installed.

So far I have authored two articles on managing services using powershell:

  1. Start/Stop/Restart service on remote computer with powershell
  2. PowerShell: Start and stop services on remote computer with alternate credentials

The first one I wrote when I was not matured enough with PowerShell and the second one recently to address a specific requirement where user need to pass alternate credentials to manage services.

As most system administrators love to use poweshell one-liners which avoids any external script/module invocation, I want to share this little one which starts, stops, and restarts a service on remote computer.

Start a service on remote computer:

Start-Service -InputObject $(Get-Service -Computer COMPUTER1 -Name spooler)

Stop a service on remote computer:

Stop-Service -InputObject $(Get-Service -Computer COMPUTER1 -Name spooler)

Restart a service on remote computer:

Restart-Service -InputObject $(Get-Service -Computer COMPUTER1 -Name spooler)

Hope these little ones helps.

PowerShell: How to assign the output to a variable and print on console at same time

November 22, 2011 Leave a comment

We want to assign output of a cmdlet/function to a variable so that we can use it in further processing. In scripts it is very inconvenient to debug a issue if the output is going to a variable and not to console. In such cases we can do nothing other than printing the variable value to the console by inserting extra lines of code.

To avoid such inconvenience, powershell has got a way to assign the output to a variable and print to console at the same time. This helped me in quick debugging of my scripts and oneliners.

Ok. Enough explaining about the usage and all and here is how it works.

($service = Get-Service -Name spooler)

Execute the command and you will understand what exactly it is doing. All we need to do it embed the whole command into into brackets like shown above.

Hope this little one helps you. Happy learning.

 

 

PowerShell: Convert your VB scripts to PowerShell

November 12, 2011 Leave a comment

The popularity of PowerShell is increasing day-to-day and now every System administrator want to say bye to their VB scripts and enter the powerful powershell world. A system administrator who is familiar with VB script(or has in home grown scripts in VB) want to try powershell, the first question he gets into mind is, “how to do xyz task in powershell”. Of course, we can ask our big brother google.com but it will take little long to find the powershell way of coding a task.

For those kind of admins, MS has published a long list of converting xyz from VB script to PowerShell. This pretty much enough for a person who wants to convert their VB scripts into powershell code. For your easy reference I am posting the content from MS technet site to here.

Hope this helps…

Cmdlets and Add-ons
Converting Dictionary Object to Windows PowerShell Commands
Converting VBScript Commands to Windows PowerShell Commands
Converting VBScript’s Abs Function
Converting VBScript’s Addition Operator
Converting VBScript’s And Operator
Converting VBScript’s Array Function
Converting VBScript’s Asc Function
Converting VBScript’s Assignment Operator
Converting VBScript’s Atn Function
Converting VBScript’s CBool Function
Converting VBScript’s CByte Function
Converting VBScript’s CCur Function
Converting VBScript’s CDate Function
Converting VBScript’s CDbl Function
Converting VBScript’s CInt Function
Converting VBScript’s CLng Function
Converting VBScript’s CSng Function
Converting VBScript’s CStr Function
Converting VBScript’s Call Statement
Converting VBScript’s Chr Function
Converting VBScript’s Class Statement
Converting VBScript’s Clear Method
Converting VBScript’s Concatenation Operator
Converting VBScript’s Const Statement
Converting VBScript’s Cos Function
Converting VBScript’s CreateObject Function
Converting VBScript’s Date Function
Converting VBScript’s DateAdd Function
Converting VBScript’s DateDiff Function
Converting VBScript’s DatePart Function
Converting VBScript’s DateSerial Function
Converting VBScript’s DateValue Function
Converting VBScript’s Day Function
Converting VBScript’s Dim Statement
Converting VBScript’s Division Operator
Converting VBScript’s Do…Loop Statement
Converting VBScript’s Eqv Operator
Converting VBScript’s Erase Statement
Converting VBScript’s Err Object Description Property
Converting VBScript’s Err Object HelpContext Property
Converting VBScript’s Err Object HelpFile Property
Converting VBScript’s Err Object Number Property
Converting VBScript’s Err Object Source Property
Converting VBScript’s Escape Function
Converting VBScript’s Eval Function
Converting VBScript’s Execute Statement
Converting VBScript’s ExecuteGlobal Statement
Converting VBScript’s Exit Statement
Converting VBScript’s Exp Function
Converting VBScript’s Exponentiation Operator
Converting VBScript’s Filter Function
Converting VBScript’s Fix Function
Converting VBScript’s For Each…Next Statement
Converting VBScript’s For…Next Statement
Converting VBScript’s FormatCurrency Function
Converting VBScript’s FormatDateTime Function
Converting VBScript’s FormatNumber Function
Converting VBScript’s FormatPercent Function
Converting VBScript’s Function Statement
Converting VBScript’s GetLocale Function
Converting VBScript’s GetObject Function
Converting VBScript’s GetRef Function
Converting VBScript’s Hex Function
Converting VBScript’s Hour Function
Converting VBScript’s If…Then…Else Statement
Converting VBScript’s Imp Operator
Converting VBScript’s InStr Function
Converting VBScript’s InStrRev Function
Converting VBScript’s InputBox Function
Converting VBScript’s Int Function
Converting VBScript’s Integer Division Operator
Converting VBScript’s Is Operator
Converting VBScript’s IsArray Function
Converting VBScript’s IsDate Function
Converting VBScript’s IsEmpty Function
Converting VBScript’s IsNull Function
Converting VBScript’s IsNumeric Function
Converting VBScript’s IsObject Function
Converting VBScript’s Join Function
Converting VBScript’s LBound Function
Converting VBScript’s LCase Function
Converting VBScript’s LTrim Function
Converting VBScript’s Left Function
Converting VBScript’s Len Function
Converting VBScript’s LoadPicture Function
Converting VBScript’s Log Function
Converting VBScript’s Mid Function
Converting VBScript’s Minute Function
Converting VBScript’s Mod Operator
Converting VBScript’s Month Function
Converting VBScript’s MonthName Function
Converting VBScript’s MsgBox Function
Converting VBScript’s Multiplication Operator
Converting VBScript’s Not Operator
Converting VBScript’s Now Function
Converting VBScript’s Oct Function
Converting VBScript’s On Error Statement
Converting VBScript’s Option Explicit Statement
Converting VBScript’s Or Operator
Converting VBScript’s Property Get Statement
Converting VBScript’s Property Let Statement
Converting VBScript’s Property Set Statement
Converting VBScript’s Public Statement
Converting VBScript’s RGB Function
Converting VBScript’s RTrim Function
Converting VBScript’s Raise Method
Converting VBScript’s Randomize Statement
Converting VBScript’s ReDim Statement
Converting VBScript’s Rem Statement
Converting VBScript’s Replace Function
Converting VBScript’s Right Function
Converting VBScript’s Rnd Function
Converting VBScript’s Round Function
Converting VBScript’s ScriptEngine Function
Converting VBScript’s ScriptEngineBuildVersion Function
Converting VBScript’s ScriptEngineMajorVersion Function
Converting VBScript’s ScriptEngineMinorVersion Function
Converting VBScript’s Second Function
Converting VBScript’s Select Case Statement
Converting VBScript’s Set Statement
Converting VBScript’s SetLocale Function
Converting VBScript’s Sgn Function
Converting VBScript’s Sin Function
Converting VBScript’s Space Function
Converting VBScript’s Split Function
Converting VBScript’s Sqr Function
Converting VBScript’s Stop Statement
Converting VBScript’s StrComp Function
Converting VBScript’s StrReverse Function
Converting VBScript’s String Function
Converting VBScript’s Sub Statement
Converting VBScript’s Subtraction Operator
Converting VBScript’s Tan Function
Converting VBScript’s Tan Function
Converting VBScript’s Time Function
Converting VBScript’s TimeSerial Function
Converting VBScript’s TimeValue Function
Converting VBScript’s Timer Function
Converting VBScript’s Trim Function
Converting VBScript’s TypeName Function
Converting VBScript’s UBound Function
Converting VBScript’s UCase Function
Converting VBScript’s Unescape Function
Converting VBScript’s Vartype Function
Converting VBScript’s Weekday Function
Converting VBScript’s WeekdayName Function
Converting VBScript’s While…Wend Statement
Converting VBScript’s With Statement
Converting VBScript’s Xor Operator
Converting VBScript’s Year Function
Converting Windows Script Host Methods to Windows PowerShell Commands
Converting the Dictionary Object’s Add Method
Converting the Dictionary Object’s CompareMode Property
Converting the Dictionary Object’s Exists Method
Converting the Dictionary Object’s Item Property
Converting the Dictionary Object’s Items Method
Converting the Dictionary Object’s Key Property
Converting the Dictionary Object’s Keys Method
Converting the Dictionary Object’s Remove Method
Converting the Dictionary Object’s RemoveAll Method
Converting the FileSystemObject to Windows PowerShell Commands
Converting the FileSystemObject’s Add Method
Converting the FileSystemObject’s AtEndOfLine Property
Converting the FileSystemObject’s AtEndOfStream Property
Converting the FileSystemObject’s AvailableSpace Property
Converting the FileSystemObject’s BuildPath Method
Converting the FileSystemObject’s Close Method
Converting the FileSystemObject’s Column Property
Converting the FileSystemObject’s Copy Method
Converting the FileSystemObject’s CopyFile Method
Converting the FileSystemObject’s CopyFolder Method
Converting the FileSystemObject’s CreateFolder Method
Converting the FileSystemObject’s CreateTextFile Method
Converting the FileSystemObject’s DateCreated Property
Converting the FileSystemObject’s DateLastAccessed Property
Converting the FileSystemObject’s DateLastModified Property
Converting the FileSystemObject’s Delete Method
Converting the FileSystemObject’s DeleteFile Method
Converting the FileSystemObject’s DeleteFolder Method
Converting the FileSystemObject’s Drive Property
Converting the FileSystemObject’s DriveExists Method
Converting the FileSystemObject’s DriveLetter Property
Converting the FileSystemObject’s DriveType Property
Converting the FileSystemObject’s Drives Property
Converting the FileSystemObject’s FileExists Method
Converting the FileSystemObject’s FileSystem Property
Converting the FileSystemObject’s Files Property
Converting the FileSystemObject’s FolderExists Method
Converting the FileSystemObject’s FreeSpace Property
Converting the FileSystemObject’s GetAbsolutePathName Method
Converting the FileSystemObject’s GetBaseName Method
Converting the FileSystemObject’s GetDrive Method
Converting the FileSystemObject’s GetDriveName Method
Converting the FileSystemObject’s GetExtensionName Method
Converting the FileSystemObject’s GetFile Method
Converting the FileSystemObject’s GetFileName Method
Converting the FileSystemObject’s GetFileVersion Method
Converting the FileSystemObject’s GetFolder Method
Converting the FileSystemObject’s GetParentFolderName Method
Converting the FileSystemObject’s GetSpecialFolder Method
Converting the FileSystemObject’s GetStandardStream Method
Converting the FileSystemObject’s GetTempName Method
Converting the FileSystemObject’s IsReady Property
Converting the FileSystemObject’s IsRootFolder Property
Converting the FileSystemObject’s Line Property
Converting the FileSystemObject’s Move Method
Converting the FileSystemObject’s MoveFile Method
Converting the FileSystemObject’s MoveFolder Method
Converting the FileSystemObject’s Name Property
Converting the FileSystemObject’s OpenAsTextStream Method
Converting the FileSystemObject’s OpenTextFile Method
Converting the FileSystemObject’s ParentFolder Property
Converting the FileSystemObject’s Path Property
Converting the FileSystemObject’s Read Method
Converting the FileSystemObject’s ReadAll Method
Converting the FileSystemObject’s ReadLine Method
Converting the FileSystemObject’s RootFolder Property
Converting the FileSystemObject’s SerialNumber Property
Converting the FileSystemObject’s ShareName Property
Converting the FileSystemObject’s ShortName Property
Converting the FileSystemObject’s ShortPath Property
Converting the FileSystemObject’s Size Property
Converting the FileSystemObject’s Skip Method
Converting the FileSystemObject’s SkipLine Method
Converting the FileSystemObject’s SubFolders Property
Converting the FileSystemObject’s TotalSize Property
Converting the FileSystemObject’s Type Property
Converting the FileSystemObject’s VolumeName Property
Converting the FileSystemObject’s Write Method
Converting the FileSystemObject’s WriteBlankLines Method
Converting the FileSystemObject’s WriteLine Method
Converting the Windows Script Host AddWindowsPrinterConnection Method
Converting the Windows Script Host AppActivate Method
Converting the Windows Script Host Close Method
Converting the Windows Script Host ConnectObject Method
Converting the Windows Script Host Count Method
Converting the Windows Script Host CreateObject Method
Converting the Windows Script Host DisconnectObject Method
Converting the Windows Script Host Echo Method
Converting the Windows Script Host EnumNetworkDrives Method
Converting the Windows Script Host EnumPrinterConnections Method
Converting the Windows Script Host Exec Method
Converting the Windows Script Host Execute Method
Converting the Windows Script Host Exists Method
Converting the Windows Script Host ExpandEnvironmentStrings Method
Converting the Windows Script Host GetObject Method
Converting the Windows Script Host GetResource Method
Converting the Windows Script Host LogEvent Method
Converting the Windows Script Host MapNetworkDrive Method
Converting the Windows Script Host Popup Method
Converting the Windows Script Host Quit Method
Converting the Windows Script Host Read Method
Converting the Windows Script Host ReadAll Method
Converting the Windows Script Host ReadLine Method
Converting the Windows Script Host RegDelete Method
Converting the Windows Script Host RegRead Method
Converting the Windows Script Host RegWrite Method
Converting the Windows Script Host Remove Method
Converting the Windows Script Host RemoveNetworkDrive Method
Converting the Windows Script Host RemovePrinterConnection Method
Converting the Windows Script Host Run Method
Converting the Windows Script Host Save Method
Converting the Windows Script Host SendKeys Method
Converting the Windows Script Host SetDefaultPrinter Method
Converting the Windows Script Host ShowUsage Method
Converting the Windows Script Host SignFile Method
Converting the Windows Script Host Skip Method
Converting the Windows Script Host SkipLine Method
Converting the Windows Script Host Sleep Method
Converting the Windows Script Host Terminate Method
Converting the Windows Script Host VerifyFile Method
Converting the Windows Script Host Write Method
Converting the Windows Script Host WriteBlankLines Method
Converting the Windows Script Host WriteLine Method
Introduction to Windows PowerShell Transactions
Introduction to Windows PowerShell 2.0 CTP v2
Join the Social
Remoting Quoting
Script Editors
Searching Active Directory with Windows PowerShell
Select-String Cmdlet Updates
Specops Command
The Get-Random Cmdlet
The Out-GridView Cmdlet: Displaying Information in a Data Grid
The Out-Gridview Cmdlet: Filter With Out-GridView
The Set-StrictMode Cmdlet
The Windows PowerShell Debugger
WMI Enhancements in Windows PowerShell 2.0 CTP
WMI Event Monitoring
Workflow Studio

PowerShell: How to get list of mapped drives

November 11, 2011 Leave a comment

Mapped drives are the shares on remote computers for which you assigned a drive letter for easier access. We can query these drives and the target shares behind them with a simple and easy powershell one liner.

Here is the tip of the day. Happy Learning.

 

Get-WmiObject -Class Win32_MappedLogicalDisk | select Name, ProviderName

 

only administrators have permission to add software during terminal services. if you want to install or configure software on server contact your admistrator

November 10, 2011 Leave a comment

You might see the error message outlined in subject while installing/uninstalling software on windows 2003 computer by connecting to terminal services. We all know that application installation has certain limitations when it comes to terminal services (anyone know why?). In such cases if you still want to install/uninstall the application on these terminal services enabled servers, you need to choose one of the following methods.

If this the requirement is just one of the case, then option#1 best suits you.

Option#1:

start mstsc with /console or /admin option and then connect to the server. This allows you to connect to the console of the server directly eliminating terminal services piece from you way.

Go to start -> Run -> type “mstsc /admin /v:servername” and click OK if you are using RDP client v6 or above

Go to start ->Run -> type “mstsc /console /v:servername” and click OK if you are using legacy version of RDP client.

Option#2:

If your administrators are expected to install applications on servers by connecting via terminal services, then you need to make sure that application installation is allowed. You can do it via group policies.

“computer configuration” -> “administrative templates” -> “windows components” -> “windows installer” -> “allow admin to install from terminal server session” should be enabled

Hope this helps.

Command line to disable network connection in windows 2008/Windows 7

July 11, 2011 1 comment

I inspired from my previous post,  and decide to do some network interface related operations from command line as they helps me when managing Windows 2008 Core Operating system. Another command that I am going to provide now is to disable network connection from command line.

netsh interface set interface name=”Local Area Connection 1″ admin=DISABLED

In about command, “Local Area Connection 1″ is the name of the connection that you want to disable. You can change the value of “Admin” to “Enable” to enable back the network connection. Similarly, if you want to rename the network connection, you can use newname parameter. Below is the command.

netsh interface set interface name=”Local Area Connection 1″ newname=”My NIC1″

Above command renames “Local Area Connection 1″ network to “My NIC1″.

Hope this helps…

Reset button not working in Cisco LINKSYS WRT120N wireless router

March 28, 2011 4 comments

I bought a new Cisco LINKSYS WRT120N wireless router and noticed that reset button is not working properly in it. That means if I press and hold the reset button to reset the router settings to factory defaults, it is not working. After some troubleshooting, I figured out the problem and fixed it. The solution here is to upgrade the firmware of the wireless router to latest version.

To do this, follow below steps.

  1. Download latest firmware for WRT120N wireless router from Cisco site(http://homesupport.cisco.com/en-us/wireless/lbc/WRT120N ) and save to disk
  2. Now takeout the router power -> Hold the reset button -> Connect the power
  3. Now connect a network cable from your computer to port#1 of wireless router. To surprise you here, the LED#4 glows though you connected the cable to port#1. Don’t worry…. This is not much to bother
  4. Open browser in your computer and go to http://192.168.1.1
  5. A window appears asks you to input the firmware file. Here select the file and click on reset
  6. This upgrades the firmware version to latest and now you can use the regular method for resetting the password to factory settings by holding the reset key. The reset key should work now as expected

 

Feel free to write in comments section if you have some questions.

Categories: Sysadmin, Tips Tags:

Allow normal users to start stop specific service(s)

March 10, 2011 1 comment

It is very common requirement that most system administrators will get. They will be requested for allowing some domain user to restart specific service on specific server. In this case most Administrators, either adds the domain user to power users groups or local administrators group. While this works, it is not a efficient solution as it allow the domain user to perform more actions in the computer than what he wants. Sometimes, it might result in server down if he does something unknowingly.

One solution in such  situations is, granting the permissions exclusively at service level. This allows the user to just start or stop the service but nothing else.

C:>setacl.exe -on spooler -ot srv -actn ace -ace “n:domainuser1;p:start_stop”
Processing ACL of: <spooler>

SetACL finished successfully.

C:>

In above example, I am trying to give start_stop permissions to spooler (print spooler) service on computer where I am running this command. 

To list the permissions of a given service, try the below command 

C:>setacl.exe -on spooler -ot srv -actn list

 

Above steps are for doing for single computer. If you want to do it on multiple computer, then  using the Group Policies is the best option. Group policies has built-in option to define service level permissions. Let me know if you need any help in doing that.

To know more option of SETACL.exe, look at the below help.

SetACL by Helge Klein

Homepage:        http://setacl.sourceforge.net

Version:         2.0.1.0

Copyright:       Helge Klein

License:         GPL

-O-P-T-I-O-N-S——————————————————–

-on    ObjectName

-ot    ObjectType

-actn  Action

-ace   “n:Trustee;p:Permission;s:IsSID;i:Inheritance;m:Mode;w:Where”

-trst  “n1:Trustee;n2:Trustee;s1:IsSID;s2:IsSID;ta:TrusteeAction;w:Where”

-dom   “n1:Domain;n2:Domain;da:DomainAction;w:Where”

-ownr  “n:Trustee;s:IsSID”

-grp   “n:Trustee;s:IsSID”

-rec   Recursion

-op    “dacl:Protection;sacl:Protection”

-rst   Where

-lst   “f:Format;w:What;i:ListInherited;s:DisplaySID”

-bckp  Filename

-log   Filename

-fltr  Keyword

-clr   Where

-silent

-P-A-R-A-M-E-T-E-R-S————————————————-

ObjectName:      Name of the object to process (e.g. ‘c:mydir’)

ObjectType:      Type of object:

                 file:       Directory/file

                 reg:        Registry key

                 srv:        Service

                 prn:        Printer

                 shr:        Network share

Action:          Action(s) to perform:

                 ace:        Process ACEs specified by parameter(s) ‘-ace’

                 trustee:    Process trustee(s) specified by parameter(s)

                             ’-trst’.

                 domain:     Process domain(s) specified by parameter(s)

                             ‘-dom’.

                 list:       List permissions. A backup file can be

                             specified by parameter ‘-bckp’. Controlled by

                             parameter ‘-lst’.

                 restore:    Restore entire security descriptors backed up

                             using the list function. A file containing the

                             backup has to be specified using the parameter

                             ‘-bckp’. The listing has to be in SDDL format.

                 setowner:   Set the owner to trustee specified by parameter

                             ‘-ownr’.

                 setgroup:   Set the primary group to trustee specified by

                             parameter ‘-grp’.

                 clear:      Clear the ACL of any non-inherited ACEs. The

                             parameter ‘-clr’ controls whether to do this for

                             the DACL, the SACL, or both.

                 setprot:    Set the flag ‘allow inheritable permissions from

                             the parent object to propagate to this object’ to

                             the value specified by parameter ‘-op’.

                 rstchldrn:  Reset permissions on all sub-objects and enable

                             propagation of inherited permissions. The

                             parameter ‘-rst’ controls whether to do this for

                             the DACL, the SACL, or both.

TrusteeAction:   Action to perform on trustee specified:

                 remtrst:    Remove all ACEs belonging to trustee specified.

                 repltrst:   Replace trustee ‘n1′ by ‘n2′ in all ACEs.

                 cpytrst:    Copy the permissions for trustee ‘n1′ to ‘n2′.

DomainAction:    Action to perform on domain specified:

                 remdom:     Remove all ACEs belonging to trustees of domain

                             specified.

                 repldom:    Replace trustees from domain ‘n1′ by trustees with

                             same name from domain ‘n2′ in all ACEs.

                 cpydom:     Copy permissions from trustees from domain ‘n1′ to

                             trustees with same name from domain ‘n2′ in all

                             ACEs.

Trustee:         Name or SID of trustee (user or group). Format:

                 a) [(computer | domain)]name

                 Where:

                 computer:   DNS or NetBIOS name of a computer -> ‘name’ must

                             be a local account on that computer.

                 domain:     DNS or NetBIOS name of a domain -> ‘name’ must

                             be a domain user or group.

                 name:       user or group name

                 If no computer or domain name is given, SetACL tries to find

                 a SID for ‘name’ in the following order:

                 1. built-in accounts and well-known SIDs

                 2. local accounts

                 3. primary domain

                 4. trusted domains

                 b) SID string

Domain:          Name of a domain (NetBIOS or DNS name).

Permission:      Permission to set. Validity of permissions depends on the

                 object type (see below). Comma separated list.

                 Example:    ‘read,write_ea,write_dacl’

IsSID:           Is the trustee name a SID?

                 y:          Yes

                 n:          No

DisplaySID:      Display trustee names as SIDs?

                 y:          Yes

                 n:          No

                 b:          Both (names and SIDs)

Inheritance:     Inheritance flags for the ACE. This may be a comma separated

                 list containing the following:

                 so:         sub-objects

                 sc:         sub-containers

                 np:         no propagation

                 io:         inherit only

                 Example:    ‘io,so’

Mode:            Access mode of this ACE:

                 a) DACL:

                 set:        Replace all permissions for given trustee by

                             those specified.

                 grant:      Add permissions specified to existing permissions

                             for given trustee.

                 deny:       Deny permissions specified.

                 revoke:     Remove permissions specified from existing

                             permissions for given trustee.

                 b) SACL:

                 aud_succ:   Add an audit success ACE.

                 aud_fail:   Add an audit failure ACE.

                 revoke:     Remove permissions specified from existing

                             permissions for given trustee.

Where:           Apply settings to DACL, SACL, or both (comma separated list):

                 dacl

                 sacl

                 dacl,sacl

Recursion:       Recursion settings, depends on object type:

                 a) file:

                 no:         No recursion.

                 cont:       Recurse, and process directories only.

                 obj:        Recurse, and process files only.

                 cont_obj:   Recurse, and process directories and files.

                 b) reg:

                 no:         Do not recurse.

                 yes:        Do Recurse.

Protection:      Controls the flag ‘allow inheritable permissions from the

                 parent object to propagate to this object’:

                 nc:         Do not change the current setting.

                 np:         Object is not protected, i.e. inherits from

                             parent.

                 p_c:        Object is protected, ACEs from parent are

                             copied.

                 p_nc:       Object is protected, ACEs from parent are not

                             copied.

Format:          Which list format to use:

                 sddl:       Standardized SDDL format. Only listings in this

                             format can be restored.

                 csv:        SetACL’s csv format.

                 tab:        SetACL’s tabular format.

What:            Which components of security descriptors to include in the

                 listing. (comma separated list):

                 d:          DACL

                 s:          SACL

                 o:          Owner

                 g:          Primary group

                 Example:    ‘d,s’

ListInherited:   List inherited permissions?

                 y:          Yes

                 n:          No

Filename:        Name of a (unicode) file used for list/backup/restore

                 operations or logging.

Keyword:         Keyword to filter object names by. Names containing this

                 keyword are not processed.

-R-E-M-A-R-K-S——————————————————–

Required parameters (all others are optional):

                 -on         (Object name)

                 -ot         (Object type)

Parameters that may be specified more than once:

                 -actn       (Action)

                 -ace        (Access control entry)

                 -trst       (Trustee)

                 -dom        (Domain)

                 -fltr       (Filter keyword)

Only actions specified by parameter(s) ‘-actn’ are actually performed,

regardless of the other options set.

Order in which multiple actions are processed:

                 1.          restore

                 2.          clear

                 3.          trustee

                 4.          domain

                 5.          ace, setowner, setgroup, setprot

                 6.          rstchldrn

                 7.          list

-V-A-L-I-D–P-E-R-M-I-S-S-I-O-N-S————————————-

a) Standard permission sets (combinations of specific permissions)

Files / Directories:

              read:          Read

              write:         Write

              list_folder:   List folder

              read_ex:       Read, execute

              change:        Change

              profile:       = change + write_dacl

              full:          Full access

Printers:

              print:         Print

              man_printer:   Manage printer

              man_docs:      Manage documents

              full:          Full access

Registry:

              read:          Read

              full:          Full access

Service:

              read:          Read

              start_stop:    Start / Stop

              full:          Full access

Share:

              read:          Read

              change:        Change

              full:          Full access

b) Specific permissions

Files / Directories:

              traverse:      Traverse folder / execute file

              list_dir:      List folder / read data

              read_attr:     Read attributes

              read_ea:       Read extended attributes

              add_file:      Create files / write data

              add_subdir:    Create folders / append data

              write_attr:    Write attributes

              write_ea:      Write extended attributes

              del_child:     Delete subfolders and files

              delete:        Delete

              read_dacl:     Read permissions

              write_dacl:    Write permissions

              write_owner:   Take ownership

Registry:

              query_val:     Query value

              set_val:       Set value

              create_subkey: Create subkeys

              enum_subkeys:  Enumerate subkeys

              notify:        Notify

              create_link:   Create link

              delete:        Delete

              write_dacl:    Write permissions

              write_owner:   Take ownership

              read_access:   Read control

Categories: Tips Tags: ,