Back to Index
This page describes param to InvokeRmOperation call and returned value from OnRmOperationResult for snapinId = 15006.
- 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.
- Warning
- Operations in this snap-in do not support international characters.
Operation: Check if supported
snapinId=15006 opId=0
Check if host supports Shared folders subsystem (Snap-In) for RM calls.
Parameters
Returns
Supported 1 if supports, 0 if not
Operation: Get shares
snapinId=15006 opId=701
Parameters
Returns
{
"PCName" : "HOST",
"Shares" : [
{
"ClientConnections" : 0,
"Description" : "Remote IPC",
"FolderPath" : "",
"Groups" : [],
"MaxUsers" : -1,
"Name" : "IPC$",
"Type" : 2147483651,
"Users" : []
},
{
"ClientConnections" : 0,
"Description" : "Default share",
"FolderPath" : "D:\\",
"Groups" : [],
"MaxUsers" : -1,
"Name" : "D$",
"Type" : 2147483648,
"Users" : []
},
{
"ClientConnections" : 0,
"Description" : "Test share",
"FolderPath" : "c:\\shared",
"Groups" : [
{
"AceType" : 1,
"DomainName" : "NT AUTHORITY",
"GroupDescr" : "",
"GroupFullName" : "",
"GroupName" : "BATCH",
"GroupRights" : 1245631
},
{
"AceType" : 0,
"DomainName" : "NT AUTHORITY",
"GroupDescr" : "",
"GroupFullName" : "",
"GroupName" : "ANONYMOUS LOGON",
"GroupRights" : 1179817
}
],
"MaxUsers" : 1,
"Name" : "tt",
"Type" : 0,
"Users" : [
{
"AceType" : 0,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "user1",
"UserName" : "user1",
"UserRights" : 1245631
},
{
"AceType" : 0,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "user2",
"UserName" : "user2",
"UserRights" : 1179817
},
{
"AceType" : 1,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "user3",
"UserName" : "user3",
"UserRights" : 1179817
}
]
},
{
"ClientConnections" : 0,
"Description" : "Remote Admin",
"FolderPath" : "C:\\WINDOWS",
"Groups" : [],
"MaxUsers" : -1,
"Name" : "ADMIN$",
"Type" : 2147483648,
"Users" : []
},
{
"ClientConnections" : 0,
"Description" : "Default share",
"FolderPath" : "C:\\",
"Groups" : [],
"MaxUsers" : -1,
"Name" : "C$",
"Type" : 2147483648,
"Users" : []
}
],
"StartAt" : -1,
"Total" : 5,
"UpTo" : 5
}
Type
- 0 Disk drive.
- 1 Print queue
- 2 Communication device.
- 3 Interprocess communication (IPC).
additionally bits can be set:
- 0x80000000 Special share reserved for interprocess communication (IPC$) or remote administration of the server (ADMIN$). Can also refer to administrative shares such as C$, D$, E$, and so forth. For more information, see the network management share functions.
- 0x40000000 A temporary share.
GroupRights/UserRights - can include bitwise the following values:
host is Win9x kind
- 0x1 Read
- 0x3 Change
- 0x37 Full control
#define CUSTOM_READ_95 (ACCESS_READ)
#define CUSTOM_CHANGE_95 (CUSTOM_READ_95 | ACCESS_WRITE )
#define CUSTOM_FULL_95 (CUSTOM_CHANGE_95 | ACCESS_CREATE | ACCESS_DELETE | ACCESS_ATRIB )
host is WinNT kind
- 0x1200a9 Read
- 0x1301bf Change
- 0x1f01ff Full control
#define CUSTOM_READ (ACCESS_READ | ACCESS_EXEC | ACCESS_ATRIB | READ_CONTROL | SYNCHRONIZE | 0x00000080)
#define CUSTOM_CHANGE (CUSTOM_READ | ACCESS_WRITE | ACCESS_CREATE | ACCESS_DELETE | DELETE | 0x00000100)
#define CUSTOM_FULL (CUSTOM_CHANGE | ACCESS_PERM | WRITE_DAC | WRITE_OWNER | STANDARD_RIGHTS_REQUIRED | STANDARD_RIGHTS_ALL)
AceType How GroupRights/UserRights are applied:
Search MSDN on SHARE_INFO_502, NetShareGetInfo for further details.
Operation: Get sessions
snapinId=15006 opId=702
Parameters
Returns
{
"PCName" : "HOST",
"Sessions" : [
{
"Computer" : "203.0.113.1",
"ConnTime" : 84283,
"FileOpens" : 3,
"Guest" : 0,
"IdleTime" : 0,
"Transport" : "\\Device\\NetbiosSmb",
"Type" : "",
"UserName" : "E.USER"
}
],
"StartAt" : -1,
"Total" : 1,
"UpTo" : 1
}
Operation: Get files
snapinId=15006 opId=703
Parameters
Returns
{
"Files" : [
{
"AccessedBy" : "E.USER",
"FileID" : 22,
"Locks" : 0,
"Name" : "C:\\TcpView",
"OpenMode" : 1,
"Type" : 0
},
{
"AccessedBy" : "E.USER",
"FileID" : 23,
"Locks" : 0,
"Name" : "C:\\TcpView\\Eula.txt",
"OpenMode" : 1,
"Type" : 0
},
{
"AccessedBy" : "E.USER",
"FileID" : 24,
"Locks" : 0,
"Name" : "C:\\TcpView\\tcpview.chm",
"OpenMode" : 1,
"Type" : 0
}
],
"PCName" : "HOST",
"StartAt" : -1,
"Total" : 3,
"UpTo" : 3
}
Operation: Set share
snapinId=15006 opId=704
Parameters
{
"Access" : 0,
"Description" : "",
"Groups" : [
{
"AceType" : 0,
"DomainName" : "",
"GroupName" : "Everyone",
"GroupRights" : 1179817
}
],
"MaxUsers" : 35,
"Name" : "tt",
"RoPass" : "",
"RwPass" : "",
"Type" : 0,
"Users" : [
{
"AceType" : 0,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "",
"UserName" : "adenyo",
"UserRights" : 1179817
},
{
"AceType" : 0,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "user",
"UserName" : "7thside",
"UserRights" : 2032127
},
{
"AceType" : 0,
"DomainName" : "OFFICE",
"UserDescr" : "",
"UserFullName" : "service",
"UserName" : "jira",
"UserRights" : 1179817
}
]
}
Returns
See Get share for field values descrition.
Operation: Remove share
snapinId=15006 opId=705
Parameters
{
"Name" : "Some share"
}
Returns
Operation: Remove session
snapinId=15006 opId=706
Parameters
{
"Computer" : "computername",
"UserName" : "username"
}
Computer, UserName as returned by Get sessions command
Returns
Operation: Remove file
snapinId=15006 opId=707
Parameters
Returns
Operation: Add share
snapinId=15006 opId=708
Parameters
{
"Description" : "Test share for testing",
"FolderPath" : "c:\\Test",
"Name" : "Test",
"Permissions" : 0
}
Returns
Search MSDN on NetShareAdd() function for further details.