-
Notifications
You must be signed in to change notification settings - Fork 1
Get NPSession
Used to establish a Authenticated Session with the NPrinting API's
Get-NPSession [[-Computer] <String>] [[-Port] <String>] [-Prefix <String>] [-Return] [-Credentials <PSCredential>] [-TrustAllCerts] [<CommonParameters>]
Get-NPSession [-Return] [-Credentials <PSCredential>] [<CommonParameters>]
Simply using 'Get-NPSession' will assume that NPrinting is running on the current machine (where you are running the Script from). It will attempt to connect to NPrinting with the Current Logged on users credentials. It will use the Default Port and HTTPS for the connection.
Default Values
C:\PS> Get-NPSession
User will use default credentials to connect to NPrinting on the local machine, using default values for prefix and port
Alternative Credentials
C:\PS> $Creds = Get-Credential
Get-NPSession -Credentials $Creds -TrustAllCerts
User will be prompted for Credentials, once entered these credentials will be used to connect to NPrinting on the local machine, using default values for prefix and port.
Non-defaults
C:\PS> $Creds = Get-Credentials
Get-NPSession -Credentials $Creds -TrustAllCerts -Computer http://NPr1nt01:9999
User will be prompted for Credentials, once entered these credentials will be used to connect to NPrinting running on a system called NPr1nt01 using http on port 9999 NB: why you would do that is anyone's guess... maybe you just like making life difficult for yourself?
used to specify if HTTP or HTTPS is to be used to establish the connection
Type: String
Parameter Sets: Default
Aliases:
Required: false
Position: named
Default Value: https
Accepted Values: http
https
Pipeline Input: False
Used to specify the NPrinting Server to connect to. can be used to specify Prefix and Port values as well. e.g. computername https://computername:port
Type: String
Parameter Sets: Default
Aliases:
Required: false
Position: 0
Default Value: $ENV:ComputerName
Pipeline Input: False
Port that NPrinting is running on
Type: String
Parameter Sets: Default
Aliases:
Required: false
Position: 1
Default Value: 4993
Pipeline Input: False
Returns the Authentication token to the Script. This can then be used for customized API calls not using the module
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: false
Position: named
Default Value:
Pipeline Input: False
Used to specify specific user credentials to connect to the API with. If omitted session will be established with current logged on users credentials
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: false
Position: named
Default Value:
Pipeline Input: False
Switch parameter used to ignore Certificate Issuer Trust.
Type: SwitchParameter
Parameter Sets: Default
Aliases:
Required: false
Position: named
Default Value:
Pipeline Input: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
No one reads this far down the help! You must have skimmed... anyway you win a cookie!!! Congratulations. Cookies can be collected from the cookie collection booth on the Fifth Sunday in February on any given Leap Year, next scheduled collection time: 2032-02-29 from 9:25am-9:28am
Generated by: PowerShell HelpWriter 2019 v2.3.42