Reply to topic  [ 13 posts ] 
Mac script help (please) 
Author Message
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
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

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Thu Jul 07, 2011 9:19 am
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
I don't have my Mac at work...I'll have a little look later if no one else replies :)


Thu Jul 07, 2011 9:51 am
Profile WWW
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
forquare1 wrote:
I don't have my Mac at work...I'll have a little look later if no one else replies :)


Cheers

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Thu Jul 07, 2011 9:54 am
Profile WWW
Spends far too much time on here
User avatar

Joined: Fri Apr 24, 2009 8:38 am
Posts: 2967
Location: Dorchester, Dorset
Reply with quote
Do you have access to a mac? Wouldn't workgroup manager do all that for you?

_________________
I've finally invented something that works!

A Mac User.


Thu Jul 07, 2011 10:13 am
Profile
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
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

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Thu Jul 07, 2011 10:24 am
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
For reference later, what format would be good?
Something like:
Code:
user    group, group    share, share, share


:?:


Thu Jul 07, 2011 11:12 am
Profile WWW
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
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

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Thu Jul 07, 2011 12:39 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
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


Thu Jul 07, 2011 10:06 pm
Profile WWW
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
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

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Fri Jul 08, 2011 7:06 am
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
Evening Sas, are your shares SMB/AFP/NFS.etc.? or a mix of different shares?


Sat Jul 09, 2011 6:07 pm
Profile WWW
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
forquare1 wrote:
Evening Sas, are your shares SMB/AFP/NFS.etc.? or a mix of different shares?


SMB & AFP I believe.

Cheers mate

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Sat Jul 09, 2011 7:38 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
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


Sun Jul 10, 2011 2:31 pm
Profile WWW
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
That looks brilliant.
I'll give it a go tomorrow & let you know the results

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Sun Jul 10, 2011 7:35 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.