PowerShell for Windows Admins:

May, 2014


May 28, 2014  1:39 PM

File system ACLs–function to add ACL

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
NTFS permissions, PowerShell

I thought that today I’d start putting together a function to add an ACL to a file system object. The starting point is the code that stepped through the process in an earlier post: Bookmark and Share     0 Comments     RSS Feed     Email a friend

May 28, 2014  12:51 PM

PowerShell Scripting Best Practices

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell scripting

Ed Wilson is running a series on Best Practices on his Hey, Scripting Guy blog at the moment.  I especially like today’s which is on simple scripts.  I do a lot of quick and dirty scripts that end up being thrown away at the  end of the project or incorporated into more formal modules for...


May 27, 2014  1:21 PM

File system ACLs – copying ACLs

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
NTFS permissions, PowerShell

A comment was left on the first post in the series asking if I could show how to copy ACLs from one object to another.  For the sake of this post we’ll assume that the ACLs from c:\test will be copied to c:\test2. If this is one shot deal you can just use the PowerShell pipeline: Get-Acl...


May 26, 2014  11:05 AM

File System ACLs – creating an ACL

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
NTFS permissions, PowerShell

Last time you saw that the permissions assign to a file system object are built from instances of the System.Security.AccessControl.FileSystemAccessRule class.  Run Get-Acl -Path c:\test | fl * and look at the Access property. Drilling into an individual ACL they look like...


May 25, 2014  5:58 AM

File System ACLs – Get-Acl #1 – Retrieving permissions

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
NTFS permissions, PowerShell

Following on from the recent set of posts about setting security permissions on shares I thought it about time I looked at the file system security permissions. PowerShell supplies 2 cmdlets, in the core engine, Get-Acl and Set-Acl for workign with permissions. These two cmdlets are part of the...


May 23, 2014  1:46 AM

Remove entry from trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

The last variant I want to show is removing a single entry from the list function remove-trustedhost { [CmdletBinding()] param ( [string]$trustedhost, [string]$computername = $env:COMPUTERNAME ) if (Test-Connection -ComputerName $computername -Quiet -Count 1) { $th = Get-WSManInstance...


May 22, 2014  11:39 AM

Clearing the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

Sometimes you may just need to clear out all of the current values in the trusted hosts list and start again – especially in a lab environment where you may be experimenting. function clear-trustedhost { [CmdletBinding()] param ( [string]$computername = $env:COMPUTERNAME ) if...


May 22, 2014  10:40 AM

Adding to the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

Its OK to be able to read the contents of the trusted hosts list but what about adding values to it? function add-trustedhost { [CmdletBinding()] param ( [string]$trustedhost, [string]$computername = $env:COMPUTERNAME ) if (Test-Connection -ComputerName $computername -Quiet -Count 1)...


May 20, 2014  1:21 PM

Reading the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

One of the sessions I did at the recent PowerShell summit was on using the WSMAN cmdlets. In my experience, these cmdlets aren’t used much. This is for a couple of reasons I think – the syntax is a bit difficult and there are often other ways to perform the task. This short series of posts...


May 19, 2014  1:00 PM

Share Permissions – setting deny

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

The last change to the share permissions functions to modify the Set-SharePermissions functions to enable the application of Deny permissions. The function becomes: #requires -Version 3.0 function Set-SharePermission { [CmdletBinding()] param...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: