<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>PowerShell - Test-Privilege - Carbon</title>
	<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
    	<ul id="SiteNav">
		<li><a href="/">Get-Carbon</a></li>
		<li>-Documentation</li>
        <li><a href="../releasenotes.html">-ReleaseNotes</a></li>
		<li><a href="http://pshdo.com">-Blog</a></li>
	</ul>
<div id="CommandMenuContainer" style="float:left;">
	<ul id="CategoryMenu">
		<li class="Category">ActiveDirectory</li>
		<ul class="CommandMenu">
			<li><a href="Find-ADUser.html">Find-ADUser</a></li>
			<li><a href="Format-ADSearchFilterValue.html">Format-ADSearchFilterValue</a></li>
			<li><a href="Get-ADDomainController.html">Get-ADDomainController</a></li>
		</ul>
		<li class="Category">Certificates</li>
		<ul class="CommandMenu">
			<li><a href="Get-Certificate.html">Get-Certificate</a></li>
			<li><a href="Get-CertificateStore.html">Get-CertificateStore</a></li>
			<li><a href="Get-SslCertificateBinding.html">Get-SslCertificateBinding</a></li>
			<li><a href="Install-Certificate.html">Install-Certificate</a></li>
			<li><a href="Remove-SslCertificateBinding.html">Remove-SslCertificateBinding</a></li>
			<li><a href="Set-SslCertificateBinding.html">Set-SslCertificateBinding</a></li>
			<li><a href="Test-SslCertificateBinding.html">Test-SslCertificateBinding</a></li>
			<li><a href="Uninstall-Certificate.html">Uninstall-Certificate</a></li>
		</ul>
		<li class="Category">COM</li>
		<ul class="CommandMenu">
			<li><a href="Get-ComPermission.html">Get-ComPermission</a></li>
			<li><a href="Get-ComSecurityDescriptor.html">Get-ComSecurityDescriptor</a></li>
			<li><a href="Grant-ComPermission.html">Grant-ComPermission</a></li>
			<li><a href="Revoke-ComPermission.html">Revoke-ComPermission</a></li>
		</ul>
		<li class="Category">Computer</li>
		<ul class="CommandMenu">
			<li><a href="Get-ProgramInstallInfo.html">Get-ProgramInstallInfo</a></li>
			<li><a href="Remove-EnvironmentVariable.html">Remove-EnvironmentVariable</a></li>
			<li><a href="Resolve-NetPath.html">Resolve-NetPath</a></li>
			<li><a href="Set-EnvironmentVariable.html">Set-EnvironmentVariable</a></li>
			<li><a href="Test-OSIs32Bit.html">Test-OSIs32Bit</a></li>
			<li><a href="Test-OSIs64Bit.html">Test-OSIs64Bit</a></li>
		</ul>
		<li class="Category">Cryptography</li>
		<ul class="CommandMenu">
			<li><a href="New-RsaKeyPair.html">New-RsaKeyPair</a></li>
			<li><a href="Protect-String.html">Protect-String</a></li>
			<li><a href="Unprotect-String.html">Unprotect-String</a></li>
		</ul>
		<li class="Category">DotNet</li>
		<ul class="CommandMenu">
			<li><a href="Set-DotNetAppSetting.html">Set-DotNetAppSetting</a></li>
			<li><a href="Set-DotNetConnectionString.html">Set-DotNetConnectionString</a></li>
			<li><a href="Test-DotNet.html">Test-DotNet</a></li>
		</ul>
		<li class="Category">DSC</li>
		<ul class="CommandMenu">
			<li><a href="Clear-DscLocalResourceCache.html">Clear-DscLocalResourceCache</a></li>
			<li><a href="Clear-MofAuthoringMetadata.html">Clear-MofAuthoringMetadata</a></li>
			<li><a href="Copy-DscResource.html">Copy-DscResource</a></li>
			<li><a href="Get-DscError.html">Get-DscError</a></li>
			<li><a href="Get-DscWinEvent.html">Get-DscWinEvent</a></li>
			<li><a href="Initialize-Lcm.html">Initialize-Lcm</a></li>
			<li><a href="Start-DscPullConfiguration.html">Start-DscPullConfiguration</a></li>
			<li><a href="Test-DscTargetResource.html">Test-DscTargetResource</a></li>
			<li><a href="Write-DscError.html">Write-DscError</a></li>
		</ul>
		<li class="Category">DSC Resources</li>
		<ul class="CommandMenu">
			<li><a href="Carbon_EnvironmentVariable.html">Carbon_EnvironmentVariable</a></li>
			<li><a href="Carbon_FirewallRule.html">Carbon_FirewallRule</a></li>
			<li><a href="Carbon_IniFile.html">Carbon_IniFile</a></li>
			<li><a href="Carbon_Permission.html">Carbon_Permission</a></li>
			<li><a href="Carbon_Privilege.html">Carbon_Privilege</a></li>
			<li><a href="Carbon_ScheduledTask.html">Carbon_ScheduledTask</a></li>
			<li><a href="Carbon_Service.html">Carbon_Service</a></li>
		</ul>
		<li class="Category">FileSystem</li>
		<ul class="CommandMenu">
			<li><a href="Compress-Item.html">Compress-Item</a></li>
			<li><a href="Disable-NtfsCompression.html">Disable-NtfsCompression</a></li>
			<li><a href="Enable-NtfsCompression.html">Enable-NtfsCompression</a></li>
			<li><a href="Expand-Item.html">Expand-Item</a></li>
			<li><a href="Install-Junction.html">Install-Junction</a></li>
			<li><a href="New-Junction.html">New-Junction</a></li>
			<li><a href="New-TempDirectory.html">New-TempDirectory</a></li>
			<li><a href="Remove-Junction.html">Remove-Junction</a></li>
			<li><a href="Test-NtfsCompression.html">Test-NtfsCompression</a></li>
			<li><a href="Test-PathIsJunction.html">Test-PathIsJunction</a></li>
			<li><a href="Test-ZipFile.html">Test-ZipFile</a></li>
			<li><a href="Uninstall-Junction.html">Uninstall-Junction</a></li>
		</ul>
		<li class="Category">Firewall</li>
		<ul class="CommandMenu">
			<li><a href="Assert-FirewallConfigurable.html">Assert-FirewallConfigurable</a></li>
			<li><a href="Disable-FirewallStatefulFtp.html">Disable-FirewallStatefulFtp</a></li>
			<li><a href="Enable-FirewallStatefulFtp.html">Enable-FirewallStatefulFtp</a></li>
			<li><a href="Get-FirewallRule.html">Get-FirewallRule</a></li>
			<li><a href="Test-FirewallStatefulFtp.html">Test-FirewallStatefulFtp</a></li>
		</ul>
		<li class="Category">HostsFile</li>
		<ul class="CommandMenu">
			<li><a href="Get-PathToHostsFile.html">Get-PathToHostsFile</a></li>
			<li><a href="Remove-HostsEntry.html">Remove-HostsEntry</a></li>
			<li><a href="Reset-HostsFile.html">Reset-HostsFile</a></li>
			<li><a href="Set-HostsEntry.html">Set-HostsEntry</a></li>
		</ul>
		<li class="Category">IIS</li>
		<ul class="CommandMenu">
			<li><a href="Add-IisDefaultDocument.html">Add-IisDefaultDocument</a></li>
			<li><a href="Disable-IisSecurityAuthentication.html">Disable-IisSecurityAuthentication</a></li>
			<li><a href="Enable-IisDirectoryBrowsing.html">Enable-IisDirectoryBrowsing</a></li>
			<li><a href="Enable-IisSecurityAuthentication.html">Enable-IisSecurityAuthentication</a></li>
			<li><a href="Enable-IisSsl.html">Enable-IisSsl</a></li>
			<li><a href="Get-IisApplication.html">Get-IisApplication</a></li>
			<li><a href="Get-IisAppPool.html">Get-IisAppPool</a></li>
			<li><a href="Get-IisConfigurationSection.html">Get-IisConfigurationSection</a></li>
			<li><a href="Get-IisHttpHeader.html">Get-IisHttpHeader</a></li>
			<li><a href="Get-IisHttpRedirect.html">Get-IisHttpRedirect</a></li>
			<li><a href="Get-IisMimeMap.html">Get-IisMimeMap</a></li>
			<li><a href="Get-IisSecurityAuthentication.html">Get-IisSecurityAuthentication</a></li>
			<li><a href="Get-IisVersion.html">Get-IisVersion</a></li>
			<li><a href="Get-IisWebsite.html">Get-IisWebsite</a></li>
			<li><a href="Install-IisApplication.html">Install-IisApplication</a></li>
			<li><a href="Install-IisAppPool.html">Install-IisAppPool</a></li>
			<li><a href="Install-IisVirtualDirectory.html">Install-IisVirtualDirectory</a></li>
			<li><a href="Install-IisWebsite.html">Install-IisWebsite</a></li>
			<li><a href="Invoke-AppCmd.html">Invoke-AppCmd</a></li>
			<li><a href="Join-IisVirtualPath.html">Join-IisVirtualPath</a></li>
			<li><a href="Lock-IisConfigurationSection.html">Lock-IisConfigurationSection</a></li>
			<li><a href="Remove-IisMimeMap.html">Remove-IisMimeMap</a></li>
			<li><a href="Set-IisHttpHeader.html">Set-IisHttpHeader</a></li>
			<li><a href="Set-IisHttpRedirect.html">Set-IisHttpRedirect</a></li>
			<li><a href="Set-IisMimeMap.html">Set-IisMimeMap</a></li>
			<li><a href="Set-IisWebsiteID.html">Set-IisWebsiteID</a></li>
			<li><a href="Set-IisWebsiteSslCertificate.html">Set-IisWebsiteSslCertificate</a></li>
			<li><a href="Set-IisWindowsAuthentication.html">Set-IisWindowsAuthentication</a></li>
			<li><a href="Test-IisAppPool.html">Test-IisAppPool</a></li>
			<li><a href="Test-IisConfigurationSection.html">Test-IisConfigurationSection</a></li>
			<li><a href="Test-IisSecurityAuthentication.html">Test-IisSecurityAuthentication</a></li>
			<li><a href="Test-IisWebsite.html">Test-IisWebsite</a></li>
			<li><a href="Uninstall-IisAppPool.html">Uninstall-IisAppPool</a></li>
			<li><a href="Uninstall-IisWebsite.html">Uninstall-IisWebsite</a></li>
			<li><a href="Unlock-IisConfigurationSection.html">Unlock-IisConfigurationSection</a></li>
		</ul>
		<li class="Category">INI</li>
		<ul class="CommandMenu">
			<li><a href="Remove-IniEntry.html">Remove-IniEntry</a></li>
			<li><a href="Set-IniEntry.html">Set-IniEntry</a></li>
			<li><a href="Split-Ini.html">Split-Ini</a></li>
		</ul>
		<li class="Category">InternetExplorer</li>
		<ul class="CommandMenu">
			<li><a href="Disable-IEEnhancedSecurityConfiguration.html">Disable-IEEnhancedSecurityConfiguration</a></li>
			<li><a href="Enable-IEActivationPermission.html">Enable-IEActivationPermission</a></li>
		</ul>
		<li class="Category">MSI</li>
		<ul class="CommandMenu">
			<li><a href="Invoke-WindowsInstaller.html">Invoke-WindowsInstaller</a></li>
		</ul>
		<li class="Category">MSMQ</li>
		<ul class="CommandMenu">
			<li><a href="Get-MsmqMessageQueue.html">Get-MsmqMessageQueue</a></li>
			<li><a href="Get-MsmqMessageQueuePath.html">Get-MsmqMessageQueuePath</a></li>
			<li><a href="Grant-MsmqMessageQueuePermission.html">Grant-MsmqMessageQueuePermission</a></li>
			<li><a href="Install-Msmq.html">Install-Msmq</a></li>
			<li><a href="Install-MsmqMessageQueue.html">Install-MsmqMessageQueue</a></li>
			<li><a href="Reset-MsmqQueueManagerID.html">Reset-MsmqQueueManagerID</a></li>
			<li><a href="Test-MsmqMessageQueue.html">Test-MsmqMessageQueue</a></li>
			<li><a href="Uninstall-MsmqMessageQueue.html">Uninstall-MsmqMessageQueue</a></li>
		</ul>
		<li class="Category">Network</li>
		<ul class="CommandMenu">
			<li><a href="Get-IPAddress.html">Get-IPAddress</a></li>
			<li><a href="Test-IPAddress.html">Test-IPAddress</a></li>
		</ul>
		<li class="Category">Path</li>
		<ul class="CommandMenu">
			<li><a href="Get-PathProvider.html">Get-PathProvider</a></li>
			<li><a href="Resolve-FullPath.html">Resolve-FullPath</a></li>
			<li><a href="Resolve-PathCase.html">Resolve-PathCase</a></li>
			<li><a href="Resolve-RelativePath.html">Resolve-RelativePath</a></li>
			<li><a href="Test-UncPath.html">Test-UncPath</a></li>
		</ul>
		<li class="Category">PerformanceCounters</li>
		<ul class="CommandMenu">
			<li><a href="Get-PerformanceCounter.html">Get-PerformanceCounter</a></li>
			<li><a href="Install-PerformanceCounter.html">Install-PerformanceCounter</a></li>
			<li><a href="Test-PerformanceCounter.html">Test-PerformanceCounter</a></li>
			<li><a href="Test-PerformanceCounterCategory.html">Test-PerformanceCounterCategory</a></li>
			<li><a href="Uninstall-PerformanceCounterCategory.html">Uninstall-PerformanceCounterCategory</a></li>
		</ul>
		<li class="Category">PowerShell</li>
		<ul class="CommandMenu">
			<li><a href="Add-TrustedHost.html">Add-TrustedHost</a></li>
			<li><a href="Clear-TrustedHost.html">Clear-TrustedHost</a></li>
			<li><a href="Get-PowerShellModuleInstallPath.html">Get-PowerShellModuleInstallPath</a></li>
			<li><a href="Get-PowershellPath.html">Get-PowershellPath</a></li>
			<li><a href="Get-TrustedHost.html">Get-TrustedHost</a></li>
			<li><a href="Invoke-PowerShell.html">Invoke-PowerShell</a></li>
			<li><a href="Set-TrustedHost.html">Set-TrustedHost</a></li>
			<li><a href="Test-PowerShellIs32Bit.html">Test-PowerShellIs32Bit</a></li>
			<li><a href="Test-PowerShellIs64Bit.html">Test-PowerShellIs64Bit</a></li>
		</ul>
		<li class="Category">Privileges</li>
		<ul class="CommandMenu">
			<li><a href="Get-Privilege.html">Get-Privilege</a></li>
			<li><a href="Grant-Privilege.html">Grant-Privilege</a></li>
			<li><a href="Revoke-Privilege.html">Revoke-Privilege</a></li>
			<li><a href="Test-Privilege.html">Test-Privilege</a></li>
		</ul>
		<li class="Category">Registry</li>
		<ul class="CommandMenu">
			<li><a href="Get-RegistryKeyValue.html">Get-RegistryKeyValue</a></li>
			<li><a href="Install-RegistryKey.html">Install-RegistryKey</a></li>
			<li><a href="Remove-RegistryKeyValue.html">Remove-RegistryKeyValue</a></li>
			<li><a href="Set-RegistryKeyValue.html">Set-RegistryKeyValue</a></li>
			<li><a href="Test-RegistryKeyValue.html">Test-RegistryKeyValue</a></li>
		</ul>
		<li class="Category">ScheduledTasks</li>
		<ul class="CommandMenu">
			<li><a href="Get-ScheduledTask.html">Get-ScheduledTask</a></li>
			<li><a href="Install-ScheduledTask.html">Install-ScheduledTask</a></li>
			<li><a href="Test-ScheduledTask.html">Test-ScheduledTask</a></li>
			<li><a href="Uninstall-ScheduledTask.html">Uninstall-ScheduledTask</a></li>
		</ul>
		<li class="Category">Security</li>
		<ul class="CommandMenu">
			<li><a href="Assert-AdminPrivilege.html">Assert-AdminPrivilege</a></li>
			<li><a href="Convert-SecureStringToString.html">Convert-SecureStringToString</a></li>
			<li><a href="ConvertTo-ContainerInheritanceFlags.html">ConvertTo-ContainerInheritanceFlags</a></li>
			<li><a href="ConvertTo-InheritanceFlag.html">ConvertTo-InheritanceFlag</a></li>
			<li><a href="ConvertTo-PropagationFlag.html">ConvertTo-PropagationFlag</a></li>
			<li><a href="Get-Permission.html">Get-Permission</a></li>
			<li><a href="Grant-Permission.html">Grant-Permission</a></li>
			<li><a href="New-Credential.html">New-Credential</a></li>
			<li><a href="Protect-Acl.html">Protect-Acl</a></li>
			<li><a href="Revoke-Permission.html">Revoke-Permission</a></li>
			<li><a href="Test-AdminPrivilege.html">Test-AdminPrivilege</a></li>
			<li><a href="Test-Permission.html">Test-Permission</a></li>
		</ul>
		<li class="Category">Service</li>
		<ul class="CommandMenu">
			<li><a href="Assert-Service.html">Assert-Service</a></li>
			<li><a href="Get-ServiceAcl.html">Get-ServiceAcl</a></li>
			<li><a href="Get-ServiceConfiguration.html">Get-ServiceConfiguration</a></li>
			<li><a href="Get-ServicePermission.html">Get-ServicePermission</a></li>
			<li><a href="Get-ServiceSecurityDescriptor.html">Get-ServiceSecurityDescriptor</a></li>
			<li><a href="Grant-ServiceControlPermission.html">Grant-ServiceControlPermission</a></li>
			<li><a href="Grant-ServicePermission.html">Grant-ServicePermission</a></li>
			<li><a href="Install-Service.html">Install-Service</a></li>
			<li><a href="Restart-RemoteService.html">Restart-RemoteService</a></li>
			<li><a href="Revoke-ServicePermission.html">Revoke-ServicePermission</a></li>
			<li><a href="Set-ServiceAcl.html">Set-ServiceAcl</a></li>
			<li><a href="Test-Service.html">Test-Service</a></li>
			<li><a href="Uninstall-Service.html">Uninstall-Service</a></li>
		</ul>
		<li class="Category">Shares</li>
		<ul class="CommandMenu">
			<li><a href="Install-SmbShare.html">Install-SmbShare</a></li>
		</ul>
		<li class="Category">Text</li>
		<ul class="CommandMenu">
			<li><a href="ConvertFrom-Base64.html">ConvertFrom-Base64</a></li>
			<li><a href="ConvertTo-Base64.html">ConvertTo-Base64</a></li>
		</ul>
		<li class="Category">UsersAndGroups</li>
		<ul class="CommandMenu">
			<li><a href="Add-GroupMember.html">Add-GroupMember</a></li>
			<li><a href="Get-Group.html">Get-Group</a></li>
			<li><a href="Get-User.html">Get-User</a></li>
			<li><a href="Get-WmiLocalUserAccount.html">Get-WmiLocalUserAccount</a></li>
			<li><a href="Install-Group.html">Install-Group</a></li>
			<li><a href="Install-User.html">Install-User</a></li>
			<li><a href="Remove-GroupMember.html">Remove-GroupMember</a></li>
			<li><a href="Resolve-Identity.html">Resolve-Identity</a></li>
			<li><a href="Test-Group.html">Test-Group</a></li>
			<li><a href="Test-Identity.html">Test-Identity</a></li>
			<li><a href="Test-User.html">Test-User</a></li>
			<li><a href="Uninstall-User.html">Uninstall-User</a></li>
		</ul>
		<li class="Category">WindowsFeatures</li>
		<ul class="CommandMenu">
			<li><a href="Get-WindowsFeature.html">Get-WindowsFeature</a></li>
			<li><a href="Install-WindowsFeature.html">Install-WindowsFeature</a></li>
			<li><a href="Test-WindowsFeature.html">Test-WindowsFeature</a></li>
			<li><a href="Uninstall-WindowsFeature.html">Uninstall-WindowsFeature</a></li>
		</ul>
		<li class="Category">Xml</li>
		<ul class="CommandMenu">
			<li><a href="Convert-XmlFile.html">Convert-XmlFile</a></li>
		</ul>
	</ul>
</div>


    <h1>Test-Privilege</h1>
<div><p>Tests if an identity has a given privilege.</p></div>

<h2>Syntax</h2>
<pre class="Syntax"><code>Test-Privilege [-Identity] &lt;String&gt; [-Privilege] &lt;String&gt; [&lt;CommonParameters&gt;]</code></pre>
    
<h2>Description</h2>
<div class="Description">
<p>Returns <code>true</code> if an identity has a privilege.  <code>False</code> otherwise.</p>
</div>
    
<h2>Related Commands</h2>
<ul>
<li><a href="Carbon_Privilege.html">Carbon_Privilege</a></li>
<li><a href="Get-Privilege.html">Get-Privilege</a></li>
<li><a href="Grant-Privilege.html">Grant-Privilege</a></li>
<li><a href="Revoke-Privilege.html">Revoke-Privilege</a></li>
</ul>

<h2> Parameters </h2>
<table border='1'>
<tr>
	<th>Name</th>
    <th>Type</th>
	<th>Description</th>
	<th>Required?</th>
	<th>Pipeline Input</th>
	<th>Default Value</th>
</tr>
<tr valign='top'>
	<td>Identity</td>
	<td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String</a></td>
	<td>The identity whose privileges to check.</td>
	<td>true</td>
	<td>false</td>
    <td></td>
</tr>
<tr valign='top'>
	<td>Privilege</td>
	<td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String</a></td>
	<td>The privilege to check.</td>
	<td>true</td>
	<td>false</td>
    <td></td>
</tr>

</table>
        

        

        

        
<h2>EXAMPLE 1</h2>
<pre><code>Test-Privilege -Identity Forrester -Privilege SeServiceLogonRight</code></pre>
<p>Tests if <code>Forrester</code> has the <code>SeServiceLogonRight</code> privilege.</p>
</body>
</html>
