New-MgPrintPrinter
Create (register) a printer with the Universal Print service. This is a long-running operation and as such, it returns a printerCreateOperation that can be used to track and verify the registration of the printer. For help creating the required Certificate Signing Request (CSR) for creating printer, see the CSR generation code sample.
Note
To view the beta release of this cmdlet, view New-MgBetaPrintPrinter
Syntax
New-MgPrintPrinter
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-CertificateSigningRequest <IMicrosoftGraphPrintCertificateSigningRequest>]
[-ConnectorId <String>]
[-DisplayName <String>]
[-HasPhysicalDevice]
[-Manufacturer <String>]
[-Model <String>]
[-PhysicalDeviceId <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-MgPrintPrinter
-BodyParameter <IPaths18VwyqhPrintPrintersMicrosoftGraphCreatePostRequestbodyContentApplicationJsonSchema>
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create (register) a printer with the Universal Print service. This is a long-running operation and as such, it returns a printerCreateOperation that can be used to track and verify the registration of the printer. For help creating the required Certificate Signing Request (CSR) for creating printer, see the CSR generation code sample.
Permissions
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Printer.Create | Printer.FullControl.All, Printer.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Not supported. | Not supported. |
Examples
Example 1: Code snippet
Import-Module Microsoft.Graph.Devices.CloudPrint
$params = @{
displayName = "Test Printer"
manufacturer = "Test Printer Manufacturer"
model = "Test Printer Model"
physicalDeviceId = $null
hasPhysicalDevice = $false
certificateSigningRequest = @{
content = '{content}'
transportKey = '{sampleTransportKey}'
}
connectorId = $null
}
New-MgPrintPrinter -BodyParameter $params
This example shows how to use the New-MgPrintPrinter Cmdlet.
Parameters
-AdditionalProperties
Additional Parameters
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BodyParameter
. To construct, see NOTES section for BODYPARAMETER properties and create a hash table.
Type: | IPaths18VwyqhPrintPrintersMicrosoftGraphCreatePostRequestbodyContentApplicationJsonSchema |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-CertificateSigningRequest
printCertificateSigningRequest To construct, see NOTES section for CERTIFICATESIGNINGREQUEST properties and create a hash table.
Type: | IMicrosoftGraphPrintCertificateSigningRequest |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConnectorId
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-HasPhysicalDevice
.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Headers
Optional headers that will be added to the request.
Type: | IDictionary |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Manufacturer
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Model
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PassThru
Returns true when the command succeeds
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PhysicalDeviceId
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProgressAction
{{ Fill ProgressAction Description }}
Type: | ActionPreference |
Aliases: | proga |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResponseHeadersVariable
Optional Response Headers Variable.
Type: | String |
Aliases: | RHV |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.Graph.PowerShell.Models.IPaths18VwyqhPrintPrintersMicrosoftGraphCreatePostRequestbodyContentApplicationJsonSchema
System.Collections.IDictionary
Outputs
System.Boolean
Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
BODYPARAMETER <IPaths18VwyqhPrintPrintersMicrosoftGraphCreatePostRequestbodyContentApplicationJsonSchema>
: .
[(Any) <Object>]
: This indicates any property can be added to this object.[CertificateSigningRequest <IMicrosoftGraphPrintCertificateSigningRequest>]
: printCertificateSigningRequest[(Any) <Object>]
: This indicates any property can be added to this object.[Content <String>]
: A base64-encoded pkcs10 certificate request. Read-only.[TransportKey <String>]
: The base64-encoded public portion of an asymmetric key that is generated by the client. Read-only.
[ConnectorId <String>]
:[DisplayName <String>]
:[HasPhysicalDevice <Boolean?>]
:[Manufacturer <String>]
:[Model <String>]
:[PhysicalDeviceId <String>]
:
CERTIFICATESIGNINGREQUEST <IMicrosoftGraphPrintCertificateSigningRequest>
: printCertificateSigningRequest
[(Any) <Object>]
: This indicates any property can be added to this object.[Content <String>]
: A base64-encoded pkcs10 certificate request. Read-only.[TransportKey <String>]
: The base64-encoded public portion of an asymmetric key that is generated by the client. Read-only.