Back to Index
This page describes param to InvokeRmOperation call and returned value from OnRmOperationResult for snapinId = 15010.
- Note
When operation fails, OnRmOperationResult comes with non-zero status and Error object in value:
{
"Error" : {
"code" : 4101,
"message" : "Failed to send RM command"
}
}
When status is zero, value is as provided in following documentation.
Paged output
RM requests may yield lots of data so responses are restricted in size.
That's where StartAt, UpTo and Total are used.
StartAt
- -1 value - execute request on the host, cache data, return starting part of the data
- >=0 value - get cached data from that position
UpTo says which StartAt use next to continue data retrieval
Total says how many data at all. When UpTo equals to Total, then all data has been retrieved.
Operation: Check if supported
snapinId=15010 opId=0
Check if host supports Users and groups subsystem (Snap-In) for RM calls.
Parameters
Returns
Supported 1 if supports, 0 if not
Operation: Get users
snapinId=15010 opId=1101
Parameters
Returns
{
"StartAt" : 0,
"Total" : 8,
"UpTo" : 8,
"Users" : [
{
"Description" : "Built-in account for administering the computer/domain",
"Flags" : 66049,
"FullName" : "",
"Name" : "Administrator"
},
{
"Description" : "",
"Flags" : 66049,
"FullName" : "",
"Name" : "TestUser1"
},
{
"Description" : "",
"Flags" : 66049,
"FullName" : "Test user",
"Name" : "testuser"
},
{
"Description" : "Built-in account for guest access to the computer/domain",
"Flags" : 66083,
"FullName" : "",
"Name" : "Guest"
},
{
"Description" : "Account for Providing Remote Assistance",
"Flags" : 66051,
"FullName" : "Remote Desktop Help Assistant Account",
"Name" : "HelpAssistant"
},
{
"Description" : "This is a vendor's account for the Help and Support Service",
"Flags" : 66051,
"FullName" : "CN=Microsoft Corporation,L=Redmond,S=Washington,C=US",
"Name" : "SUPPORT_388945a0"
},
{
"Description" : "user for testing WGuest rm operation",
"Flags" : 66049,
"FullName" : "Test user",
"Name" : "TestUser2"
},
{
"Description" : "",
"Flags" : 66049,
"FullName" : "WDKLclStdUsr",
"Name" : "WDKLclStdUsr"
}
]
}
Flags is bitwise OR of values (from Windows SDK lmaccess.h):
- please see MSDN documentation on NetUserGetInfo/NetUserSetInfo functions and usri*_flags field
#define UF_SCRIPT 0x0001
#define UF_ACCOUNTDISABLE 0x0002
#define UF_HOMEDIR_REQUIRED 0x0008
#define UF_LOCKOUT 0x0010
#define UF_PASSWD_NOTREQD 0x0020
#define UF_PASSWD_CANT_CHANGE 0x0040
#define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x0080
#define UF_TEMP_DUPLICATE_ACCOUNT 0x0100
#define UF_NORMAL_ACCOUNT 0x0200
#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800
#define UF_WORKSTATION_TRUST_ACCOUNT 0x1000
#define UF_SERVER_TRUST_ACCOUNT 0x2000
#define UF_DONT_EXPIRE_PASSWD 0x10000
#define UF_MNS_LOGON_ACCOUNT 0x20000
#define UF_SMARTCARD_REQUIRED 0x40000
#define UF_TRUSTED_FOR_DELEGATION 0x80000
#define UF_NOT_DELEGATED 0x100000
#define UF_USE_DES_KEY_ONLY 0x200000
#define UF_DONT_REQUIRE_PREAUTH 0x400000
#define UF_PASSWORD_EXPIRED 0x800000
#define UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x1000000
#define UF_NO_AUTH_DATA_REQUIRED 0x2000000
#define UF_PARTIAL_SECRETS_ACCOUNT 0x4000000
#define UF_USE_AES_KEYS 0x8000000
Operation: Get groups
snapinId=15010 opId=1102
Parameters
Returns
{
"Groups" : [
{
"Description" : "Administrators have complete and unrestricted access to the computer/domain",
"Name" : "Administrators"
},
{
"Description" : "Backup Operators can override security restrictions for the sole purpose of backing up or restoring files",
"Name" : "Backup Operators"
},
{
"Description" : "Guests have the same access as members of the Users group by default, except for the Guest account which is further restricted",
"Name" : "Guests"
},
{
"Description" : "Members in this group can have some administrative privileges to manage configuration of networking features",
"Name" : "Network Configuration Operators"
},
{
"Description" : "Power Users possess most administrative powers with some restrictions. Thus, Power Users can run legacy applications in addition to certified applications",
"Name" : "Power Users"
},
{
"Description" : "Members in this group are granted the right to logon remotely",
"Name" : "Remote Desktop Users"
},
{
"Description" : "Supports file replication in a domain",
"Name" : "Replicator"
},
{
"Description" : "Users are prevented from making accidental or intentional system-wide changes. Thus, Users can run certified applications, but not most legacy applications",
"Name" : "Users"
},
{
"Description" : "Group for the Help and Support Center",
"Name" : "HelpServicesGroup"
},
{
"Description" : "Tech support",
"Name" : "Support"
},
{
"Description" : "group for testing WGuest rm operation",
"Name" : "TestGroup"
}
],
"StartAt" : 0,
"Total" : 11,
"UpTo" : 11
}
Operation: Delete user
snapinId=15010 opId=1103
Parameters
Returns
Operation: Delete group
snapinId=15010 opId=1104
Parameters
Returns
Operation: Rename user
snapinId=15010 opId=1105
Parameters
{
"Name" : "TestUser",
"NewName" : "TestUser2"
}
Returns
Operation: Rename group
snapinId=15010 opId=1106
Parameters
{
"Name" : "TestGroup",
"NewName" : "TestGroup2"
}
Returns
Operation: User set password
snapinId=15010 opId=1107
Parameters
{
"Name" : "TestUser",
"Password" : "23423we23we2342"
}
Returns
Operation: Add user
snapinId=15010 opId=1108
Parameters
{
"Description" : "user for testing WGuest rm operation",
"Flags" : 66049,
"FullName" : "Test user",
"Name" : "TestUser",
"Password" : "x012sdfsdf23wer",
"PasswordExpired" : 1
}
Returns
Flags see here
Operation: Add group
snapinId=15010 opId=1109
Parameters
{
"Description" : "group for testing WGuest rm operation",
"Name" : "TestGroup",
"Users" : [
{
"Name" : "TestUser"
}
]
}
Returns
Operation: Get user prop
snapinId=15010 opId=1110
Parameters
{
"Name" : "TestUser",
"StartAt" : -1
}
Returns
{
"Groups" : [],
"StartAt" : 0,
"Total" : 1,
"UpTo" : 1,
"User" : {
"Description" : "user for testing WGuest rm operation",
"Flags" : 66049,
"FullName" : "Test user",
"HomeDrive" : "",
"HomeDriveUNC" : "",
"HomePath" : "",
"LogonScript" : "",
"PasswordExpired" : 0,
"ProfilePath" : ""
}
}
Flags see here
Operation: Get group prop
snapinId=15010 opId=1111
Parameters
{
"Name" : "TestGroup",
"StartAt" : -1
}
Returns
{
"Description" : "group for testing WGuest rm operation",
"CompName" : "HOST",
"Members" : [
{
"Name" : "HOST\\TestUser",
"SidName" : "S-1-5-21-1757981266-1979792683-839522115-1009",
"Type" : 1
}
],
"StartAt" : 0,
"Total" : 2,
"UpTo" : 2
}
Type
- 1 user
- 2 group
- 3 domain
- 4 alias
- 5 well-known group ... see MSDN on SID_NAME_USE enumeration for further information
Operation: Set user prop
snapinId=15010 opId=1112
Parameters
{
"Description" : "user for testing WGuest rm operation",
"Flags" : 66049,
"FullName" : "Test user",
"Groups" : [
{
"Name" : "TestGroup"
}
],
"HomeDrive" : "",
"HomeDriveUNC" : "",
"HomePath" : "",
"LogonScript" : "",
"Name" : "TestUser",
"PasswordExpired" : 0,
"ProfilePath" : ""
}
Returns
Flags see here
Operation: Set group prop
snapinId=15010 opId=1113
Parameters
{
"Name" : "TestGroup",
"Description" : "group for testing WGuest rm operation",
"Members" :
[
{
"Name":"HOST\\TestUser",
"Type":1
}
]
}
Returns
Type
- 1 user
- 2 group
- 3 domain
- 4 alias
- 5 well-known group ... see MSDN on SID_NAME_USE enumeration for further information