Skip to main content

Posts

PowerShell 3 behavioural change

It's taken me way too long to get into PowerShell 3, I guess opportunity hasn't shown it's self until now and so, here, my V3 journey begins. I was asked to debug a script that would run fine in PS v2 and not in v3.  The issue was a that a variable length was being checked and was failing in v3.  This is why... In v2 if a variable is undefined , this test returns false PS C:\windows\system32> $var.length -eq 0 False In v3 the same test returns true.... PS C:\windows\system32> $var.length -eq 0 True Not a biggie, but as in this case, a script has broken so something to consider! cheers Adam
Recent posts

Filesystem v 0.992

Just over a year after I published the first version of this module, and too many revisions to count later, I am fast approaching 1000 downloads!  This update takes the number of functions past 50 too!  Thanks to everyone who have given me great feedback!  The latest release can be downloaded here . For more info on the module see here . Bug Fix removed the discovery error on load Added Functions get-sharePermission (not sure why it took so long for this one to appear) get-NTFSBlockedInheritance - to compliment get-NTFSExplicitPermissions, this return the path of a folder if inheritance has been blocked updated Function get-NTFSExplicitPermissions - added an exclude parameter in the same way that get-NTFSPermission works Cheers Adam

Assigning Permissions - AGDLP

AGDLP It seems I have been mildly distracted away from the title of this blog site.   It does say AD Admin, but I seem to have been taken away by file system stuff.   I have to say, it has all been worthwhile, but it’s probably time I got back to the real heart of what I do. There are probably a million permission assigning advice pages, but I thought I would put another one out there after referring to AGDLP in my last post. So, what is this all about – AGDLP.   Well, it is something I learned in my MCSE 2003 studies and has become ingrained into my ideals since.   As a contractor, I get to move job often.   This enables me to forge opinions on how to configure things in a domain, and more importantly how NOT to configure things. AGDLP is definitely on the to do list…for anyone in any size domain or forest, as it follows some very basic principals.   I will explain these whilst I go through what AGDPL stands for. A A is for...

quick look at get-NTFSExplicitPermissions

get-NTFSExplicitPermissions As one of favourite time saving functions of late, I thought I'd continue my recent trend of blogging again by giving a bit of insight to it's background. One of the parts to my day job is looking after file servers.  I don't do day to day admin work on them, more look at managing space and migrating data to new servers / volumes if required. Now the problem with doing the data migrations and not being involved in the day to day admin work (ie assigning permissions creating shares etc) is that I have no control over how and where the permissions are assigned.  I learnt how to assign permissions to file systems years ago in Novell environments, which was soon followed with the MCSE taught A-G-D-L-P model. (AGDLP? now that sound like a reasonable blog post for an AD Admin blog site!) Anyway, I have since found that these early teaching on permission models are not implemented as thoroughly as I would like, where ever I seem to work...

new-DFSrGroup

New-DFSRGroup This function contains pretty much everything about dfs-r groups.  When you create a replication group from the GUI, have you ever noticed the steps that complete on the page after you click create? Ever paid any attention to what they are actually doing? Me neither, until I started looking at this new-dfsrgroup function.  Assuming that there are 2 members to the replication group and all parameters have been entered, my function calls dfsradmin no less that 9 times to complete the task. So how can we use the function?  here are some examples.... new-dfsrgroup -name "rg2" -description "desc1" -Servers server1,server2 -folderpath e:\data\users -foldername Users This command will invoke every part of the function and create a fully meshed replication group.  Out of the parameters presented, only name and servers are mandatory.  If you were to omit foldername eg :  new-dfsrgroup -name "rg2" -description "desc1" -Se...

Filesystem 0.99 update (DFS-R!)

Filesystem Update  Another update / bug fix for my module Filesystem. The latest release can be downloaded here . For more info on the module see here . In update v0.99, DFS-r management has been released...with a couple of other changes : NOTE: dfsradmin.exe is required to be installed for the DFSR functions to work Updated list-DFSRoots has been renamed to get-dfsroots due to list not being on the approved verb list (an alias exists to redirect list-dfsroots to get-dfsroots for now) list-DFSLinks has been renamed to get-dfslinks due to list not being on the approved verb list (an alias exists to redirect list-dfslinks to get-dfslinks for now) get-NTFSPermission - fixed issue with inherited only permissions   New DFS-r functions add-dfsrGroupMember disable-dfsrGroupMember enable-dfsrGroupMember get-DFSrGroup get-dfsrGroupConnection get-DFSRGroupfolder get-dfsrGroupMember new-DFSRgroup new-dfsrGroupConnection new-dfsrGroupFolder new-dfs...

Filesystem Module v0.98

Filesystem Update  Another update / bug fix for my module Filesystem. The latest release can be downloaded here . For more info on the module see here . In update v0.98, the follow has changed : updated get-dfslink (added path parameter to output object) New function list-DFSRoots list-DFSLinks As requested by Deas, the list functions have been added to list all DFS roots in a domain and subsequently, list all links in a dfs root. get-dfslink has been updated to add a path property to the object output.  Just for reference, I have started on my next update already.....Adding DFS-r management!   cheers Adam