Created
August 15, 2025 22:13
-
-
Save jschell/56d77d3d003f4926f118ef1b022986d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-KerberosTicketRequest | |
| { | |
| <# | |
| .NOTES | |
| #### Name: New-KerberosTicketRequest | |
| #### Author: J Schell | |
| #### Version: 0.1.0 | |
| #### License: MIT License | |
| ### Change Log | |
| ##### 2018-07-06::0.1.0 | |
| -initial creation | |
| #> | |
| [CmdletBinding()] | |
| Param | |
| ( | |
| [string] | |
| $Server, | |
| [string] | |
| $SPN = 'host' | |
| ) | |
| $target = "$($SPN)/$($Server)" | |
| Try | |
| { | |
| $ticket = [System.IdentityModel.Tokens.KerberosRequestorSecurityToken]::new($target) | |
| } | |
| Catch | |
| { | |
| if( $($Error.Exception.InnerException.InnerException.InnerException) -like "*The specified target is unknown or unreachable") | |
| { | |
| Write-Error "The specified target is unknown or unreachable" | |
| } | |
| else | |
| { | |
| Write-Error $_ | |
| } | |
| } | |
| $ticket | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment