Change user type with terminal

Hi all,
I am trying to find the commands' to be able to change a 'Service' user from an Admin user to a standard user. I have found ways to do it via single user mode however i would like to be able to do this with terminal as i will be using remote desktop to change all the service users in my company. Any help would be great
Cheers

I can't take full credit for this. I found it at:
http://farbflash.de/cgi-bin/blosxom.cgi/?find=snippets
I did, however, know the command to look for.
The commands necessary to create an admin user are as follows:
sudo -s
niutil -create . /users/username
niutil -createprop . /users/username passwd \"\"
niutil -createprop . /users/username home /Users/username
niutil -createprop . /users/username shell /bin/tcsh
niutil -createprop . /users/username uid 520
niutil -createprop . /users/username gid 20
niutil -createprop . /users/username realname \"First Last\" - if this property is not created, the user won't appear in the loginwindow!
niutil -appendprop . /groups/admin users username - only for admin users!
These below are optional:
niutil -createprop . /users/username hint \"password hint\"
niutil -createprop . /users/username writerspassword username
niutil -createprop . /users/username writershint \"\"
niutil -createprop . /users/username writerspicture username
niutil -createprop . /users/username sharedDir Public
exit
There needs to be a valid home directory, shell, and/or SharedDir for the user. A home directory can be created as easily as:
sudo mkdir /Users/username
sudo chown username:staff /Users/username
Or if you want the default OS X user directory structure:
sudo cp -rp /System/Library/User Template/English.lproj /Users/username
sudo chown -R username:staff /Users/username
(/System/Library/User Template also has other localized language templates)
Additional info:
To change an admin user back to an ordinary user:
sudo niutil -destroyval . /groups/admin users username
Be careful to leave at least one accessible admin user, otherwise you will lock yourself out of your machine.
after changing netinfo:
sudo niutil -resync .
log out and in the user you changed.

Similar Messages

  • Impact of Changing User Types

    What is the impact of changing user types from 'service' user type to either a 'communication' or 'system' user type?  Will the change stop authorizations or will it only affect administration?  Is the change related to the available fields or locking security and not necessarily related to authorizations.

    Which release are you on?
    It also depends on your config => rejecting expired passwords, compliance with current password policies (at logon...) and same user context for RFC calls.
    You should first investigate why it is a "SERVICE" type user. If it is from a config wizard with a profile delivered by SAP, then there might be a good reason for this.
    The authority checks on "SERVICE" and "SYSTEM" users are the same, except that "SYSTEM" users are not SAPGui capable. This is not only restricted to the SAPGui logon screen. And for all logon types, they are excempted from changing their password - both via the requirement to do so and the ability to do it voluntarily...
    But if they can administrate themselves, then they can (authorization object S_USER_GRP).
    The same cannot be said for "COMMUNICATION" type users. I recommend not using them at all and there are many SAP notes which correct standard config wizards to use the correct user type => SYSTEM.
    "COMMUNICATION" users are "DIALOG" users, except that when you enter the correct password via the SAPGui logon screen, then a message is returned to inform you that the user type cannot logon from that screen. But other screens will work, if the first screen is skipped.
    You can test this with transaction OBVU in the standard system, or any other Z-transaction of the same ilk.
    Cheers,
    Julius

  • How to change Users name in Terminal Users.

    Hi, I am trying to change my Users name from firstnamelastname to mac on my OSX10.7.5.
    I went to Terminal > Users and tried to rename, however upon reboot, the Terminal > Users always brings back the folder firstnamelastname.
    How can this be changed?
    I did go to Mac > Apple > System Preferences... > System > Users & Groups > Current User. This shows the firstnamelastname has been changed to Mac.
    However I need the Terminal files in /Users also changed from firstnamelastname to Mac.

    Thanks for the reply.
    I went to Mac > Apple > System Preferences... > System > Users & Groups > Login Options > Click the lock to make changes. > Password: > Unlock > Show fast user switching menu as > changed Full Name to Short Name > Click the lock to prevent further changes. > Apple > Restart...
    The Mac still had firstnamelastname in Terminal > /Users rather than the name Mac.
    I then went to Mac > Apple > System Preferences... > System > Users & Groups > Login Options > Click the lock to make changes. > Password: > Unlock > Show fast user switching menu as > changed Short Name to Full Name > Click the lock to prevent further changes. > Apple > Restart...
    The Mac still had firstnamelastname in Terminal > /Users, rather than the name Mac?
    I think the /Users folder with the folder firstnamelastname is some kind of permanent folder when I first set up the Mac, however I would still like to change the folder name, so maybe I need to set up the Mac like new or something...how to do that if there isn't a way of changing the folder name?

  • How can i add a new user and change user'password with javamail?

    how can i add a new user and change user'password from a mailserver with javamail?
    email:[email protected]

    Well user creation and updation is a system property..U need to go through that part...as it depends on the system you are hosting pout your application...
    if it is linux...u have to use some shell programming\
    bye for now let me know if this guides you or if you need some more stuff.
    bye

  • Unknown user type with POF serialization

    Hi all,
    I'm using 3.6 and am just starting to implement POF.  In general it has been pretty easy but I seem to have a problem with my near scheme and POF.  Things work ok in my unit tests, but it doesn't work when I deploy to a single instance of WebLogic 12 on my laptop.  Here is an example scheme:
    <near-scheme>
      <scheme-name>prod-near</scheme-name>
      <autostart>true</autostart>
      <front-scheme>
        <local-scheme>
          <high-units>{high-units 2000}</high-units>
          <expiry-delay>{expiry-delay 2h}</expiry-delay>
        </local-scheme>
      </front-scheme>
      <back-scheme>
        <distributed-scheme>
          <backing-map-scheme>
            <local-scheme>
              <high-units>{high-units 10000}</high-units>
              <expiry-delay>{expiry-delay 2h}</expiry-delay>
            </local-scheme>
          </backing-map-scheme>
          <serializer>
            <instance>
              <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
              <init-params>
                <init-param>
                  <param-value>/Bus/pof-config.xml</param-value>
                  <param-value>String</param-value>
                </init-param>
              </init-params>
            </instance>
          </serializer>
        </distributed-scheme>
      </back-scheme>
    </near-scheme>
    I don't know if it matter, but some of my caches use another scheme that references this one as a parent:
    <near-scheme>
      <scheme-name>daily-near</scheme-name>
      <scheme-ref>prod-near</scheme-ref>
      <autostart>true</autostart>
      <back-scheme>
        <distributed-scheme>
          <backing-map-scheme>
            <local-scheme>
              <high-units system-property="daily-near-high-units">{high-units 10000}</high-units>
              <expiry-delay>{expiry-delay 1d}</expiry-delay>
            </local-scheme>
          </backing-map-scheme>
          <serializer>
            <instance>
              <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
              <init-params>
                <init-param>
                  <param-value>/Bus/pof-config.xml</param-value>
                  <param-value>String</param-value>
                </init-param>
              </init-params>
            </instance>
          </serializer>
        </distributed-scheme>
      </back-scheme>
    </near-scheme>
    Those schemes have existed for years.  I'm only now adding the serializers.  I use this same cache config file in my unit tests, as well as the same pof config file.  My unit tests do ExternalizableHelper.toBinary(o, pofContext) and ExternalizableHelper.fromBinary(b, pofContext).  I create the test pof context by doing new ConfigurablePofContext("/Bus/pof-config.xml").  I've also tried actually putting and getting an object to and from a cache in my unit tests.  Everything works as expected.
    My type definition looks like this:
    <user-type>
      <type-id>1016</type-id>
      <class-name>com.mycompany.mydepartment.bus.service.role.RoleResource</class-name>
    </user-type>
    I'm not using the tangosol.pof.enabled system property because I don't think it's necessary with the explicit serializers.
    Here is part of a stack trace:
    (Wrapped) java.io.IOException: unknown user type: com.mycompany.mydepartment.bus.service.role.RoleResource
        at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:214)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterValueToBinary.convert(PartitionedCache.CDB:3)
        at com.tangosol.util.ConverterCollections$ConverterCacheMap.put(ConverterCollections.java:2486)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.put(PartitionedCache.CDB:1)
        at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:943)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:902)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:814)
    Any idea what I'm missing?
    Thanks
    John

    SR-APX wrote:
    Aleks
    thanks for your response.
    However the include property needs to present inside the <user-type-list> tag....
    <user-type-list> <include>coherence-pof-config.xml </include></user-type-list>
    For all other interested users the following property, tangosol.pof.enabled=true , must also be set for pof serialization to work correctly.
    Thanks again...
    ShamsurHi Shamsur,
    it is not mandatory to use tangosol.pof.enabled=true, you can alternatively specify the serializer for the clustered services to be configured for POF (not necessarily all of them) on a service-by-service basis in the cache configuration file explicitly with the following element.
    <serializer>com.tangosol.io.pof.ConfigurablePofContext</serializer>Best regards,
    Robert

  • How can i change brush type with script?

    I can already set the width, size of it, but i cant find out how to change the type. Even script listener dont produce the needed code for it.

    Never mind. I managed to do it, script listener did produce the code, i just didnt find it at first. I meant brush style by type.

  • Inadvertently deleted user folder with terminal command - HELP!

    Hi
    I was using terminal to delete my hosts file using the following command:
    sudo rm -rf /Users/xxx/.ssh/known_hosts
    Unfortunalely, I misplaced a space after the username, and deleted most of my user files. I thought something weird was happening when all the desktop icons dissappeared, and restarted immediately.
    Now I am missing all of my docs, and desktop files. Some things are preserved, like itunes library and iPhoto library. My backup is over 6 months old.
    I took out the hdd, put in an external enclosure, and hooked it up to another SL machine. I ran stellar phoenix overnight, but the recovered files all seem to be weird system files, mostly .plist files, nothing recent.
    Any suggestions?
    Thanks

    ro-76 wrote:
    Thanks for the reply.
    My main backup is over 6 months old.
    then I suggest you start backing up regularly. there is no excuse not to do it.
    I use dropbox to backup the stuff I'm working on at the moment, but not the older stuff.
    I found it strange that I could not recover anything with Stellar Phoenix. Is there something special about deleting using terminal? Does it completely erase the file?
    not unless you use srm which you didn't. but NOT data recover software as you tried is perfect nor can it be expected to be. when you delete a file either from finder or from terminal it's unlinked from the directory but the actual space it's stored on the drive is not immediately overwritten by new data. that's what makes data recovery even possible. however, from that moment on it's treated as free space and can be overwritten at any instant. as soon as this happens data recovery becomes impossible. the only true way to protect your data is to *back up*.
    I'll try Data Rescue 3.

  • Change user permissions in Terminal?

    Hey everyone. The company I work for has decided that we need to switch multiple users from admin accounts to standard accounts. Since there are multiple people across multiple machines, it will take awhile to remote into each machine and manually flip the flag in system preferences.
    Does anyone know if there is a command I can run via ssh in Terminal that will allow me to flip that switch for a specific username?

    It looks like your system may be part of an Active Directory or Open Directory domain, since the only admin accounts listed here are the system "root" account and one called "macadmin" which my guess is a single local administrator account used for binding the system to the domain.
    In this case you will have to consult your domain administrators to see how the organizational units and accounts are managed for whether or not you can assign or revoke administrative privileges for the networked accounts that it manages. These settings changes will need to be done on the domain controller system, and not on each client system that it manages.

  • Changing user type from ARD and Unix command

    I am now in charge of a Mac network encompassing many different machines, running a mix between Tiger and Leopard. I have them on ARD and would like to batch "demote" every user except my admin account on each machine to standard user privileges. What would be the command I need to send through to do this en masse?

    You could run a dscl command on the 10.5 machines. Maybe run it within a shell script that searches in the /Users folder and returns each folder name (user name). But, again this would only work on the 10.5 machines with the new directory services.

  • Can't change creator type with AppleScript

    I'm trying to change the file type and creator type of some files using AppleScript. I've found many examples telling me how to do it. My problem is, that no matter what I try, the creator type does not change. Yes, I can change the file type, but using the same syntax for the creator type fails to make any change. There is no error; rather, the creator type simply remains what it was before.
    I'm doing this on 10.6.8, but I also tried it on 10.8.4 and had the same issue.
    Here's an example script:
    After executing on a single file (for example), the alerts show that the file type has been changed, but the creator type HAS NOT, and remains what it was previously.

    Hello
    Firstly, I have posted wrong handler, which should have been:
    on set_creator_code(f, c)
            string f : POSIX path of target file
            string c : 4-character creator code (or "" to set 0x00000000)
        do shell script "/usr/bin/perl <<'EOF' - " & f's quoted form & " " & c's quoted form & "
    die \"Usage: $0 <file> [<creator code>]\" unless @ARGV > 0;
    my ($f, $c) = @ARGV;
    (my $finfo = qx[xattr -p com.apple.FinderInfo \"$f\" 2>/dev/null]) =~ s/[[:space:]]//og;
    $finfo = \"00\" x 32 unless $finfo;
    my $cccc = unpack('H8', $c . \"\\0\\0\\0\\0\");
    $finfo =~ s/ ^((?:..){4}) ((?:..){4}) /$1$cccc/ox;
    qx[xattr -w -x com.apple.FinderInfo \"$finfo\" \"$f\"];
    EOF"
    end set_creator_code
    * The previous (wrong) handler will create wrong data when there's no com.apple.FinderInfo attribute of the file. Sorry.
    By the way, this handler is written to set creator code to \0\0\0\0 when c = "". So the script below will do what you want for a file.
    set f to choose file
    set_creator_code(f's POSIX path, "")
    As for recursive processing, it is straightforward but the question is how to determine the target files. Processing every file under a given directory tree could be too broad and potentially dangerous. Can we assume the target files are all html and its name extension is .html or .htm? If so, the script below will do what you want:
    set d to choose folder
    set_creator_code_recursively(d's POSIX path, "(html|htm)", "")
    on set_creator_code_recursively(d, e, c)
            string d : POSIX path of target directory
            string e : name extension pattern (case insensitive), e.g., (html|htm|css)
            string c : 4-character creator code (or "" to set 0x00000000)
        do shell script "/usr/bin/perl <<'EOF' - " & d's quoted form & " " & e's quoted form & " " & c's quoted form & "
    die \"Usage: $0 <directory> <name extension pattern> [<creator code>]\" unless @ARGV > 1;
    my ($dir, $ext, $code) = @ARGV;
    local $/=\"\\0\";
    my @ff = map {chomp; $_} qx[find -E \"$dir\" -type f -iregex '.*\\\\.$ext\\$' -print0];
    for my $f (@ff) {
        (my $finfo = qx[xattr -p com.apple.FinderInfo \"$f\" 2>/dev/null]) =~ s/[[:space:]]//og;
        $finfo = \"00\" x 32 unless $finfo;
        my $cccc = unpack('H8', $code . \"\\0\\0\\0\\0\");
        $finfo =~ s/ ^((?:..){4}) ((?:..){4}) /$1$cccc/ox;
        qx[xattr -w -x com.apple.FinderInfo \"$finfo\" \"$f\"];
    EOF"
    end set_creator_code_recursively
    Hope this may help,
    H

  • Change user password with CUA

    When I attempt to change a password on a CUA child, I enter tocde SU01 and enter the account. The I was to reset password via the icon. When I select the change password icon (shift+ F8) and then the popup window appear to prompting you to enter and reenter password.
    After I enter new pwd twice the screen stays nothing happen pop screen stay up and no status is reported back on the status bar at the bottom.
    If I open up the account and change it via logon data table the change.reset password works fine.
    Any ideas?
    Mikie B.

    There was a similar (unconclusive) discussion recently ( Screen not getting refreshed after reseting password ), for which I found the following thread:
    Password generation problem
    Maybe that can help.

  • I would like to change users associated with my imovie project

    I'm thinking this is simple but I can't figure out how to do it (I'n new to Macs). I downloaded a movie from my camera and worked on a couple projects before realizing that I was logged in under my sons account. When I log into my account I can't find the movie or the projects. How do I transition the stuff over?

    It is simple if you have an external drive. Do you?

  • Hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,but i can't find  my data which i have saved on mac.please help me out in this matter.

    hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,
    but i can't find  my data which i have saved on mac.the storage is showing data used and free space on the disk
    please help me out in this matter.

    How did you change your user name?
    resetpassword wouldn't have done it. If you managed to create a new user, then your data is still in the old account.

  • Change selected option in ComboBox as the user types

    Is there a way to make the selected item in a ComboBox change
    as the user types? Something like an autocomplete. The default
    functionality seems to be that it will move to the next option in
    the list that starts with the letter you type...but I'd like to be
    able to type something like a last name and have it select that
    option.

    There is an autocomplete component on Flex Exchange. I don't
    have the url handy but google will find it.
    Tracy

  • Change detector failed while scanning for changes to type User

    I'm receiving lots of system log warnings in IdM.
    These warnings are not bound to any particular action in IdM, they just do appear while IdM is on.
    Almost one warning per one second.
    Change detector failed while scanning for changes to type Server
    Change detector failed while scanning for changes to type UserForm
    Change detector failed while scanning for changes to type User
    Change detector failed while scanning for changes to type Resource
    SysLog detail:
    Timestamp 123
    Event
    Server server11
    Severity Warning
    Component Repository
    Error Code OCDT00
    Message Change detector failed while scanning for changes to type User
    Reported cause java.lang.NullPointerException
    java.lang.NullPointerException
    at com.waveset.repository.ObjectChange.equals(ObjectChange.java:112)
    at java.util.HashMap.eq(HashMap.java:299)
    at java.util.HashMap.containsKey(HashMap.java:381)
    at java.util.HashSet.contains(HashSet.java:182)
    at com.waveset.repository.ObjectChangeManager$RemoteChangeDetector.dispatchChanges(ObjectChangeManager.java:398)
    at com.waveset.repository.ObjectChangeManager$RemoteChangeDetector.run(ObjectChangeManager.java:314)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)

    same here, just deployed 8.1 with oracle as db. It results in syslog table growing into 10+G and still growing.
    wonder if there are others who are seeing this.
    my "syslog -d 1" output looks like this...
    2009-12-02 04:52:55.972 null W xxx RP OCDT00 Change
    detector failed while scanning for changes to type Account
    2009-12-02 04:53:06.400 null W xxx RP OCDT00 Change
    detector failed while scanning for changes to type Server
    2009-12-02 04:53:06.578 null W xxx RP OCDT00 Change
    detector failed while scanning for changes to type User
    2009-12-02 04:53:06.914 null W xxx RP OCDT00 Change
    detector failed while scanning for changes to type Account
    2009-12-02 04:53:17.479 null W xxx RP OCDT00 Change
    detector failed while scanning for changes to type Server
    C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18\webapps\ims\bin
    lh syslog -d 1

Maybe you are looking for

  • Reconnect to existing Time Machine after disk crash?

    Hi guys! My GF's MBP disk crashed a few days ago. We've been backing it up to a NAS for the last few months. Now, after replacing the disk and reinstalling OSX Mavericks, we want to make Time Machine use the old sparsebundle as it's backup target. Yo

  • CC on Mac OS 10.8.5 not working or installing; Tech Support Useless or Non-Responsive

    I've used Adobe Products since '95. I am very comfortable with the "Industry Standard" of applications Adobe has offered up to now. I have a MacBook Pro that has happily run CS4-6 and felt that CC would be a good way to save a little $$ with a subscr

  • All of the sudden my computer is running slow

    I ran Etre here are my results Hardware Information:     iMac (24-inch, Early 2009)     iMac - model: iMac9,1     1 2.66 GHz Intel Core 2 Duo CPU: 2 cores     4 GB RAM Video Information:     NVIDIA GeForce 9400 - VRAM: 256 MB System Software:     Mac

  • Variables for Timeline Control

    I am building a somewhat sophisticated slide menu. I have input a wait(); command using setInterval in the first frame of my actions panel. My wait() function works perfectly. I have also set a few variables to start out being false. Once a particula

  • On my Macbook pro not working Facebook click to post option

    i dont kno what happend now i saw my facebook click to post option not working when i click no responds pleas help me ... any kno how to fix this issue ..