x404.co.uk
http://www.x404.co.uk/forum/

Mac script help (please)
http://www.x404.co.uk/forum/viewtopic.php?f=4&t=14128
Page 1 of 1

Author:  saspro [ Thu Jul 07, 2011 9:19 am ]
Post subject:  Mac script help (please)

I need to list all the shares on a mac server (10.4.11).
I also need to list all users & groups from the open directory installed on that server.
If I can list all users & groups with their relevant share access that would be even better.

Is this possible to do?
Can anyone help?

My googlefu is failing me

Author:  forquare1 [ Thu Jul 07, 2011 9:51 am ]
Post subject:  Re: Mac script help (please)

I don't have my Mac at work...I'll have a little look later if no one else replies :)

Author:  saspro [ Thu Jul 07, 2011 9:54 am ]
Post subject:  Re: Mac script help (please)

forquare1 wrote:
I don't have my Mac at work...I'll have a little look later if no one else replies :)


Cheers

Author:  tombolt [ Thu Jul 07, 2011 10:13 am ]
Post subject:  Mac script help (please)

Do you have access to a mac? Wouldn't workgroup manager do all that for you?

Author:  saspro [ Thu Jul 07, 2011 10:24 am ]
Post subject:  Re: Mac script help (please)

tombolt wrote:
Do you have access to a mac? Wouldn't workgroup manager do all that for you?


I have access to the mac (but only over a slow remote link).

There are over 100 users & 30 groups. Probably 50+ shares as well.

I can go through every user, group & share individually if I have to but if I can script it then I can add the scripts to my monitoring tools for future audits etc

Author:  forquare1 [ Thu Jul 07, 2011 11:12 am ]
Post subject:  Re: Mac script help (please)

For reference later, what format would be good?
Something like:
Code:
user    group, group    share, share, share


:?:

Author:  saspro [ Thu Jul 07, 2011 12:39 pm ]
Post subject:  Re: Mac script help (please)

That looks about right (I think)

I just need to be able to confirm the users listed. The groups & their members. The shares & users/groups able to access them.

Cheers for your help with this

Author:  forquare1 [ Thu Jul 07, 2011 10:06 pm ]
Post subject:  Re: Mac script help (please)

OK, groups and users aren't a problem, shares are a little more difficult. I'll likely not be able to look at the script much more until the weekend, but I'll hopefully get it to you by the end of Sunday if that's ok?

Ben

Author:  saspro [ Fri Jul 08, 2011 7:06 am ]
Post subject:  Re: Mac script help (please)

forquare1 wrote:
OK, groups and users aren't a problem, shares are a little more difficult. I'll likely not be able to look at the script much more until the weekend, but I'll hopefully get it to you by the end of Sunday if that's ok?

Ben



That would be more than OK.

Users & groups would be perfect. I can map out the shares manually if it's a ballache

Author:  forquare1 [ Sat Jul 09, 2011 6:07 pm ]
Post subject:  Re: Mac script help (please)

Evening Sas, are your shares SMB/AFP/NFS.etc.? or a mix of different shares?

Author:  saspro [ Sat Jul 09, 2011 7:38 pm ]
Post subject:  Re: Mac script help (please)

forquare1 wrote:
Evening Sas, are your shares SMB/AFP/NFS.etc.? or a mix of different shares?


SMB & AFP I believe.

Cheers mate

Author:  forquare1 [ Sun Jul 10, 2011 2:31 pm ]
Post subject:  Re: Mac script help (please)

Afternoon Sas,

On the server, running the following should get a list of groups and their users:
Code:
dscl . list /groups GroupMembership


It seems OS X server comes with a command called `sharing`, do the following to list the shares:
Code:
sharing -l


I can't see the output of this command (I only have OS X client), so I can't add it to the script, and I'm not sure if it only tells you what shares there are, or if it also states permissions...
It may be that the last command will do everything you need. If you can give me a mock/sample output of the command I can try and tailor it more to your needs if necessary.

Sorry it's taken so long and I've not really solved the whole problem. That sharing command is pretty elusive on the net...

Ben

Author:  saspro [ Sun Jul 10, 2011 7:35 pm ]
Post subject:  Re: Mac script help (please)

That looks brilliant.
I'll give it a go tomorrow & let you know the results

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/