An audit may be needed to determine all users, their roles, permissions sets and the default Business Unit assigned as well as Business Units they have access to. This can be performed by an administrator by running a script activity in Automation Studio which will write the data to Data Extensions that can then be extracted using a data extract.
DE Name: USERS_PERMISSIONS
Fieldtype FieldName Text AccountUserID Text Name Text Description Number ID Boolean IsAllowed Boolean IsDenied Boolean IsShareable Text ObjectType DE Name: USERS_ROLES
Fieldtype FieldName Text AccountUserID Text Name Text Description Text CustomerKey Boolean IsSystemDefined Text ObjectID DE Name: USERS_INFORMATION
Fieldtype FieldName Text UserID Text Name Text Email Boolean ActiveFlag Number Delete Date LastSuccessfulLogin Boolean IsAPIUser Text NotificationEmailAddress Text IsLocked Number ID Text CustomerKey Text AccountUserID
3. Create an SSJS Script activity in automation Studio using the following code:
<script runat="server" language="javascript">
Platform.Load("core","1.1");
var prox = new Script.Util.WSProxy();
try {
var usersInformationTable = "USERS_INFORMATION";
var usersRolesTable = "USERS_ROLES";
var usersPermissionsTable = "USERS_PERMISSIONS";
var queryAllAccounts = true;
var cols = [
"AccountUserID",
"ActiveFlag",
"CustomerKey",
"Email",
"ID",
"LastSuccessfulLogin",
"ModifiedDate",
"Name",
"Roles",
"UserID",
"UserPermissions"
];
// WSProxy retrieve
var res = prox.retrieve("AccountUser", cols/*, filter*/);
if (res.Status == "OK") {
var resultUsers = res.Results;
for (i in resultUsers) {
var rows = Platform.Function.InsertData(usersInformationTable,
["AccountUserID",
"Name",
"UserID",
"Email",
"NotificationEmailAddress",
"ActiveFlag",
"Delete",
"LastSuccessfulLogin",
"IsAPIUser",
"IsLocked",
"ID",
"CustomerKey"],
[resultUsers[i].AccountUserID,
resultUsers[i].Name,
resultUsers[i].UserID,
resultUsers[i].Email,
resultUsers[i].NotificationEmailAddress,
resultUsers[i].ActiveFlag,
resultUsers[i].Delete,
resultUsers[i].LastSuccessfulLogin,
resultUsers[i].IsAPIUser,
resultUsers[i].IsLocked,
resultUsers[i].ID,
resultUsers[i].CustomerKey]);
var userRoles = resultUsers[i].Roles;
for (j in userRoles) {
var rows = Platform.Function.InsertData(usersRolesTable,
["AccountUserID",
"Name",
"Description",
"CustomerKey",
"IsSystemDefined",
"ObjectID"],
[resultUsers[i].AccountUserID,
userRoles[j].Name,
userRoles[j].Description,
userRoles[j].CustomerKey,
userRoles[j].IsSystemDefined,
userRoles[j].ObjectID]);
var cols_roles = ["Permissions"];
var filter_roles = {
Property: "ObjectID",
SimpleOperator: "equals",
Value: userRoles[j].ObjectID
};
var resRoles = prox.retrieve("Role", cols_roles, filter_roles);
for (var k=0; k<resRoles.Results.length; k++) {
var permissionsArray = resRoles.Results[k].Permissions;
for (x in permissionsArray) {
var rows = Platform.Function.InsertData(usersPermissionsTable,
["AccountUserID",
"Name",
"Description",
"ObjectType",
"ID",
"IsAllowed",
"IsDenied",
"IsShareable"],
[resultUsers[i].AccountUserID,
permissionsArray[x].Name,
permissionsArray[x].Description,
permissionsArray[x].ObjectType,
permissionsArray[x].ID,
permissionsArray[x].IsAllowed,
permissionsArray[x].IsDenied,
permissionsArray[x].IsShareable]);
}
}
}
}
}
} catch (error) {
Write(Stringify(error));
}
</script>
4. Add the script to an automation and then run the script using the Run Once function
004517766

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.