New-MBSAPIAdministrator


Creates an Administrator for MBS

New-MBSAPIAdministrator
        [-Email] <String>
        [[-FirstName] <String>]
        [[-LastName] <String>]
        [[-Companies] <String[]>]
        [[-Enabled] <Boolean>]
        [-Password] <SecureString>
        [[-SendEmailInstruction] <Boolean>] 
        [[-ProfileName] <String>]
        [-PermissionsModels] <String>
        [<CommonParameters>]

Description

Calls the POST api/Administrators API to create a new administrator according to the specified parameters.


Examples

Example 1: Create a new administrator with specific permissions.

PS C:\> $PermissionModels = '{
    "Users": 1,
    "StorageLimit": 0,
    "Notification": 0,
    "OnlineAccess": 0,
    "Licenses": 0,
    "Billing": 0,
    "Monitiring": 0,
    "RemoteDeploy": 1,
    "RemoteManagment": 0,
    "HelpMarketing": 0,
    "AuditLog": 0,
    "PSA": 0,
    "Administrators": 0,
    "Rebranding": 0,
    "Storage": 0,
    "ADS": 0,
    "LicenseBuy": 0,
    "LicenseActivate": 0,
    "StorageUsage": 1,
    "CapacityReport": 0,
    "GoogleApps": 0,
    "Dashboard": 0
    }'

    New-MBSAPIAdministrator -Email 'QQQ@test.com' -password (ConvertTo-SecureString -Force -asplaintext 'test') -SendEmailInstruction $false -FirstName admin -LastName adminson -Enabled $true -PermissionsModels $PermissionModels -ProfileName profile    

Parameters

-Email

Email address of the administrator

Type String
Required: true
Position 1
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-FirstName

First name of the administrator

Type String
Required: false
Position 2
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-LastName

Last name of the administrator

Type String
Required: false
Position 3
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-Companies

List of companies the adminstrator will have access to.

Type String[]
Required: false
Position 4
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-Enabled

Whether the administrator should be enabled after creation

Type Boolean
Required: false
Position 5
Default value: True
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-Password

Password

Type SecureString
Required: true
Position 6
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-SendEmailInstruction

Whether or not to send instructions to the new administrator

Type Boolean
Required: false
Position 7
Default value: False
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

-ProfileName

Profile name used with MSP360 PowerShell for MBS API (set via Set-MBSApiCredential)

Type String
Required: false
Position 8
Default value:
Accept pipeline input: false
Accept wildcard characters: false

-PermissionsModels

JSON for administrator permissions. Valid fields can be found here: https://api.mspbackups.com/Help/ResourceModel?modelName=PermissionsModels Example can be found here: https://api.mspbackups.com/Help/Api/POST-api-Administrators

Type String
Required: true
Position 9
Default value:
Accept pipeline input: true (ByPropertyName)
Accept wildcard characters: false

CommonParameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Notes

Author: Andrey Oshukov