Skip to content

Latest commit

 

History

History
142 lines (111 loc) · 3.15 KB

New-Mga.md

File metadata and controls

142 lines (111 loc) · 3.15 KB
external help file Module Name online version schema
Optimized.Mga-help.xml
Optimized.Mga
2.0.0

New-Mga

SYNOPSIS

SYNTAX

New-Mga [-Uri] <String> [-Body <Object>] [-Api <String>] [-CustomHeader <Object>] [-ReturnAsJson]
 [<CommonParameters>]

DESCRIPTION

Creates a new object in the Azure AD tenant with the Microsoft Graph API.

EXAMPLES

EXAMPLE 1

$Body = @{
    accountEnabled    = 'true'
    displayName       = "TestUser"
    mailNickname      = "TestUser"
    userPrincipalName = "[email protected]"
    passwordProfile   = @{
        forceChangePasswordNextSignIn = 'true'
        password                      = ********
    }
}
New-Mga -Uri '/v1.0/users' -Body $Body

PARAMETERS

-Uri

Uri to the Microsoft Graph API. You can also use the last part of an Uri and the rest will be automatically added. Example: /users Example: https://graph.microsoft.com/v1.0/users Example: users?$filter=displayName eq 'Bas Wijdenes' Example: beta/users

Type: String
Parameter Sets: (All)
Aliases: URL

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Body

Body will accept a PSObject or a Json string.

Type: Object
Parameter Sets: (All)
Aliases: InputObject

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Api

This is not a mandatory parameter. By using v1.0 or beta it will always overwrite the value given in the Uri. By using All it will first try v1.0 in a try and catch. and when it jumps to the catch it will use the beta Api.

Type: String
Parameter Sets: (All)
Aliases: Reference

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CustomHeader

This not a not mandatory parameter, there is a default header containing application/json. By using this parameter you can add a custom header. The CustomHeader is reverted back to the original after the cmdlet has run.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ReturnAsJson

This is not a mandatory parameter. By using, this the output will be returned as Json. When it cannot be converted to json, it will be returned as is.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://github.com/baswijdenes/Optimized.Mga/

https://baswijdenes.com/c/microsoft/mga/