pw user export
The pw user export command exports user information (for a specified set of users) in XML format. If you run the command, and it succeeds, the information is stored by default in the pw/pronto/conf/userdata.xml file.
The syntax for this command is as follows:
<user_name n>] [-exportugr ][- file <filename>[-replace]]
pw user export all [-exportugr ] [- file <filename>[-replace]]
pw user export -f <filter option> [-f <filter option2> -f <filter option3> -f <filter option4> ] [-exportugr ] [- file <filename>
[-replace]]
- -file <filename> — Exports user information to the file you specify. If you do not use the -file option, the user information is stored in pw/pronto/conf/ userdata.xml by default.
- -replace — Overwrites the file you specified with the -file option, if it already exists.
- -f — Enables you to specify a particular filter. Only the users matching the filter criteria are exported.
- filter option — where the <filter option> can have the following value:
- userclass = admin | user
- status = enabled | disabled
- usergroup| role = <available user group name or available role name>. Exact name of the user group or role must be specified.
-exportugr (Optional) — To export user groups and roles information associated with the list of users exported.
To export user information for all the users on the BMC ProactiveNet Server, run the following command:
pw user export allThis will export user information for all users on the BMC ProactiveNet Server.
Following are some of the options used along with the pw user export all command, with some examples.
To export user information for all users on the BMC ProactiveNet Server to a specified file, for example userInfo.xml, run the following command:
pw user export all -file /usr/pw/pronto/logs/userInfo.xmlTo export the user information for all users on the BMC ProactiveNet Server to the specified file, for example, userInfo.xml,and to replace the contents of the file if it already exists, run the following command:
pw user export all -file /usr/pw/pronto/logs/userInfo.xml -replaceTo export user information for all the users on the BMC ProactiveNet Server belonging to the "admin" user group to the default location, /usr/pw/pronto/logs/UserInfo.xml, run the following command:
pw user export -user admin,ops -file /usr/pw/pronto/logs/UserInfo.xmlTo export user1, user2, and user3, run the following command:
pw user export -user user1,user2,user3To export all users belonging to userclass "admin" and status "enabled," run the following command:
pw user export -f userclass=admin -f status=enabledTo export all users belonging to userclass "user", status "enabled", and user group "Operations" along with the information about the user groups and roles associated with the users, run the following command.
pw user export -f userclass=user -f status=enabled -f usergroup="Operations" -exportugr