Questions tagged [dscl]

dscl is a general-purpose utility for operating on Directory Service directory nodes.

dscl is a general-purpose utility for operating on Directory Service directory nodes. Its commands allow one to create, read, and manage Directory Service data. If invoked without any commands, dscl runs in an interactive mode, reading commands from standard input. Interactive processing is terminated by the quit command. Leading dashes ("-") are optional for all commands.

dscl operates on a datasource specified on the command line. This may be a node name or a Mac OS X Server (10.2 or later) host specified by DNS hostname or IP address. Node names may be absolute paths beginning with a slash ("/"), or relative domain paths beginning with a dot (".") character, which specifies the local domain, or "..", specifying the local domain's parent. If the hostname or IP address form is used then the user must specify the -u option and either the -P of -p options to specify an administrative user and password on the remote host to authenticate with to the remote host. The exception to this is if "localhost" is specified. Passing passwords on the command line is inherently insecure and can cause password exposure. For better security do not provide the password as part of the command and you will be securely prompted.

27 questions
112
votes
10 answers

Authorize a non-admin developer in Xcode / Mac OS

I use a standard user account for my daily tasks on Mac OS. Since upgrading to Snow Leopard I am asked to do the following when a program is run from within Xcode: "Type the name and password of a user in the 'Developer Tools' group to allow…
Andrew Cain
  • 1,193
  • 2
  • 10
  • 8
4
votes
2 answers

Read logged in user's domain on OS X

Is there a way to identify whether the logged in account is local account or active directory account on OS X? If yes, how can we retrieve the domain name?
Seema Kadavan
  • 2,538
  • 1
  • 16
  • 31
4
votes
6 answers

Regular Expression to parse Common Name from Distinguished Name

I am attempting to parse (with sed) just First Last from the following DN(s) returned by the DSCL command in OSX terminal bash environment... CN=First Last,OU=PCS,OU=guests,DC=domain,DC=edu I have tried multiple regexs from this site and others with…
Ben
  • 63
  • 2
  • 7
3
votes
3 answers

Running script with admin permissions on OS X

I've tried my best to find out a solution with the many script questions on Stack Overflow and the internet, but I can't seem to find the solution I need. What I want to do is create a more automated and less clicking solution to remove all the…
ScottN
  • 1,490
  • 2
  • 20
  • 34
1
vote
0 answers

Migrate Local account to Mobile Account error Mac OS X Lion

I have the need to migrate users on a Mac OS X from a local account to an AD Mobile account. I had no problem doing this in 10.6 and 10.7 prior to enforcing MCX. I have a script that deleted the local account dscl entry and sets the users home…
Sonic84
  • 931
  • 1
  • 10
  • 16
1
vote
0 answers

Check if the AD domain controller is accessible from a macOS machine

There is a software which changes its behavior based on accessibility of the Active Directory domain controller (for domain joined machines). For example, if a machine inside a LAN and the domain controller is accessible, all features are available.…
Eugen
  • 479
  • 5
  • 16
1
vote
1 answer

Novell IDM Apple Open Directory LDAP Driver

I have been looking for information or examples of how to setup an IDM driver for Apple Open Directory. The articles I have found don't give much detail and pretty much no actual technical content. I am using the LDAP driver and can connect and…
JediPotPie
  • 1,068
  • 3
  • 14
  • 21
1
vote
1 answer

How to create a bash script to delete accounts on mac

I am creating a bash script to delete a user account on a mac. When I pull up terminal and type the commands sudo dscl . delete /users/username sudo rm -rf /users/username It is successful in deleting the desired account and removing the user…
spencer741
  • 965
  • 1
  • 10
  • 22
1
vote
1 answer

Command Not Executing on Certain Conditions

I am scripting up an app that will help users bind to our server's open directory if one does not exist. It will test if the command's output is empty or not and help remove any old open directory and add the new one. I am running into issues with…
Tan
  • 195
  • 1
  • 1
  • 7
1
vote
1 answer

list of uids / names of System Preferences > Accounts

How can I obtain an array with uid and names? I could iterate from 0 to 99999 and do a getpwnam(). However most machines have less than 5 accounts, so it's not optimal. I don't know what framework is responsible for this and thus I have no clue…
neoneye
  • 50,398
  • 25
  • 166
  • 151
1
vote
1 answer

Change group with chown in OSX

Trying to change the group for a file on OSX to root, keep getting an illegal group name error though. Looked around and all the demos match what I'm using. Am I missing something here? Tried to create a group with dscl as well with the same…
3therk1ll
  • 2,056
  • 4
  • 35
  • 64
1
vote
2 answers

Hidden accounts on OSX

The traditional method of creating a hidden user account on OSX (i.e does not show up on the login window or system preferences > accounts pane) is to create it with a UID of less than 501. However, on 10.8 the accounts that I'm creating with lower…
BSUK
  • 692
  • 1
  • 12
  • 28
1
vote
1 answer

Launch dscutil in Objective-C

How would I use dscl in Objective-C and obtain its output? The command I want to pass as if it is in Terminal is: dscl . -readall /Users UniqueID | awk '/^RecordName:/ {name=$2}; /^UniqueID: / {if ($2 > 500) print name}' I know how to launch…
John
  • 3,037
  • 8
  • 36
  • 68
1
vote
1 answer

strange property result for picture path of the current user in applescript

When I run: tell application "System Events" get the properties of the current user end tell in applescript, everything looks fine except for the picture path. The path referenced is not what I see as my user picture. I am probably missing…
dejay
  • 758
  • 2
  • 6
  • 18
0
votes
2 answers

(MacOS Terminal). How to produce a readable Epoch time from terminal

I am trying to give a command to a friend who has been having account passwords changed. He is trying to determine a way to figure out when the password was last changed. I was able to give him this command, that is working in MacOS terminal, but I…
Josh
  • 113
  • 1
  • 5
1
2