Re: monad : enumerate shares with permissions ?
- From: "/\\/\\o\\/\\/" <no@xxxxxxxx>
- Date: Fri, 31 Mar 2006 19:23:46 +0200
np,
if you have questions just ask, I did this script quick at work, so it's very basic but I hope it gets you going.
you can find some more info about ACL's on my blog
http://mow001.blogspot.com , try a search for ACL, you will find some more examples and links to MSH for fun, that has also some good ACL info.
also, you can find info about share permissions with WMI on my blog : http://mow001.blogspot.com/2005/11/replace-security-on-existing-share.html
I only did file ACL's local , as you need it remote you need to do it with WMI, but you can go on from the win32_share sample.
the example shows how to get from share to directory rights.
also the .NET class used to translate the accessmask (the long enum, you can use WMI as in the share example)
for more info about the WMI classes and methods you can look at the WMI help series. the update of the script from part 3 could be handy.
http://mow001.blogspot.com/2006/03/msh-get-wmimethodhelp-function-update.html
or you might find it handy to use popd
as it is remote it makes it less trival
but I hope this helps,
gr /\/\o\/\/
jmd.msdn wrote:
Thank you..
I will analyze and try to understand !
It does not seem simple.
"/\/\o\/\/ [MVP]" <oMVP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:A6783BBB-FC1A-4A90-8294-309B021F8B22@xxxxxxxxxxxxxxxxthe basics :
$computer = 'computer'
get-wmiobject win32_share -computer $computer | foreach {
"Share :"
$_ | select name,
@{e={trap{continue};[enum]::parse([System.Security.AccessControl.FileSystemRights],($_.accessmask))};n='access'},path | fl
"Dir :"
get-wmiobject win32_directory -computer $computer -filter "name =
'$($_.path.replace('\','\\'))'" | select name,
@{e={trap{continue};[enum]::parse([System.Security.AccessControl.FileSystemRights],($_.accessmask))};n='access'} | fl
}
hope this helps
gr /\/\o\/\/
"jmd.msdn" wrote:
Hello.
Is it possible, in Monad, to enumerate shares, shares permissions and ntfs
permissions on the shares trees on a remote server ?
Thank you in advance.
jmd
- Follow-Ups:
- Re: monad : enumerate shares with permissions ?
- From: jmd.msdn
- Re: monad : enumerate shares with permissions ?
- References:
- monad : enumerate shares with permissions ?
- From: jmd.msdn
- Re: monad : enumerate shares with permissions ?
- From: jmd.msdn
- monad : enumerate shares with permissions ?
- Prev by Date: Re: Quick Poll
- Next by Date: Re: Remove Service?
- Previous by thread: Re: monad : enumerate shares with permissions ?
- Next by thread: Re: monad : enumerate shares with permissions ?
- Index(es):
Relevant Pages
|
Loading