Whilst doing some research into indexed attributes, I posted this a while back on how to find your index attributes. Since then, I have looked a little deeper into what indexing really means and found this excellent explanation on the numbers that can be found in the searchflags attribute of a schema object. Using Florian’s reference, I built the following script (which is both powershell v1 and v2 compatible) to get the schema attributes from the forest schema and return (among other things) the breakdown of your attributes search flags. $forest = [System.DirectoryServices.ActiveDirectory.forest]::getcurrentforest() $schema = [ADSI]('LDAP://CN=Schema,CN=Configuration,dc=' + ($($forest).name -replace "[.]",",dc=")) $attributes = $schema.psbase.children | where {$_.objectClass -eq "attributeSchema"} $collection = @() foreach ($attr in $attributes){ $store = "" | select "Name","lDAPDisplayName","singlev...
Minor bug?
ReplyDeleteWhen I create a new folder and share, and then add-ntfspermission, my script adds the permission, but the inherited permissions are not included.
The only way I can get these to populate is either from a remote access to the folder to select the security tab, advanced, change permissions and select the "Replace all child permissions....etc" checkbox. Or on the server where the folder's been created, select the folder and when I get the prompt I don't have permissions..."continue?" Select continue and everything fine, permission entries are then populated.
Regards
Ian
can you post your code please? changing the names of anything important of course :) I'll try to emulate your issue
Deletecheers
Hi there
DeleteApologies, just seen your response.
Unfortunately, I've changed the code somewhat and don't have the original. I believe, my workaround was to create the folder first using New-Item as per:-
New-Item -Path \\server\d$\foldername -ItemType Directory
Add-NTFSPermission -path \\server\groups\$folder -object $resourcename -Permission Modify | Out-Null
New-FileShare -name $folder -server servername -path path | Out-Null
Cheers
Ian