Skip to main content
Question

Script Help - Remove Default Mac User Public Folders


apizz
Forum|alt.badge.img+15
  • Honored Contributor
  • 395 replies

Let me start off by saying we lock down the Sharing System Preference pane and disable file sharing. However, I don't like the idea of having the Mac's default public folders enabled for users.

I'd like to think I'm not that much of a scripting n00b, but am looking for some help on gathering the full share point name so I can script the removal of these default public folders for users.

I was looking at the sharing command, but I'm not coming up with a great way to parse out the full name of users' public folder when I get output like this after running sharing -l:

            List of Share Points
name:       User 1 Public Folder
path:       /Users/User 1/Public
    afp:    {
            name:   User 1 Public Folder
            shared: 1
            guest access:   1
            inherit perms:  0
    }
    ftp:    {
            name:   User 1 Public Folder
            shared: 0
            guest access:   0
    }
    smb:    {
            name:   User 1 Public Folder
            shared: 1
            guest access:   1
    }

name:       User 2 Public Folder
path:       /Users/User 2/Public
    afp:    {
            name:   User 2 Public Folder
            shared: 1
            guest access:   1
            inherit perms:  0
    }
    ftp:    {
            name:   User 2 Public Folder
            shared: 0
            guest access:   0
    }
    smb:    {
            name:   User 2 Public Folder
            shared: 1
            guest access:   1
    }

Can anyone guide me in the right direction such that I might capture the full public folder sharepoint name?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings