Remove-FsrmMgmtProperty
Remove-FsrmMgmtProperty
Removes a management property.
構文
Parameter Set: DeleteMgmtProperty2
Remove-FsrmMgmtProperty [-Name] <String> [-AsJob] [-CimSession <CimSession[]> ] [-Namespace <String> ] [-Recurse] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
The Remove-FsrmMgmtProperty cmdlet removes a management property from a namespace. A management property is a classification property that includes Folder in its AppliesTo property and whose Flags property does not include the Secure value. You can use the Get-FsrmClassificationPropertyDefinition cmdlet to get definitions of classification properties.
パラメーター
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。
エイリアス |
Session |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Name<String>
Specifies the name of a management property. Specify the value of the Name property in a FsrmClassificationPropertyDefinition object.
エイリアス |
なし |
必須? |
true |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
true |
-Namespace<String>
Specifies a local path to a folder.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Recurse
Indicates that this cmdlet removes management properties for all folders that contain management properties in the namespace. If you specify this parameter, you must specify the Namespace parameter.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ThrottleLimit<Int32>
このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0
を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
Example 1: Remove all management properties
This command removes all management properties from the server that have the value FolderUsage_MS.
PS C:\> Remove-FsrmMgmtProperty -Name "FolderUsage_MS"
Example 2: Remove a management property by using a namespace
This command removes all management properties from the namespace C:\Shares that have the value FolderUsage_MS.
PS C:\> Remove-FsrmMgmtProperty -Name "FolderUsage_MS" -Namespace "C:\Shares"
Example 3: Remove all management property in a namespace hierarchy
This command removes all management properties that have the value FolderUsage_MS from the namespace C:\Shares and any namespaces below it in the hierarchy.
PS C:\> Remove-FsrmMgmtProperty -Name "FolderUsage_MS" -Namespace "C:\Shares" -Recurse
Example 4: Remove all management properties in a namespace hierarchy
This example removes all management properties from namespaces that do not exist on the server. Property definitions are removed from a server by an administrator or as a result of group policy updates. When you remove a property definition, the management property values that the server sets on folders by using the property definition are obsolete.
The first command gets all management properties on the server and stores the results in the $props variable.
PS C:\> $props = Get-FsrmMgmtProperty
The second command is a script that identifies management properties where the property applied on folders dos not exist anymore. The script uses the Remove-FsrmMgmtProperty cmdlet to remove the management properties for which there is no corresponding property definition on the server.
PS C:\> $nonExistingProperties = $props | where { $_.Exists –ne $true}
foreach ($candidate in $nonExistingProperties)
{foreach ($prop in $_.Properties) {Remove-FsrmMgmtProperty -Name $prop.Name -Namespace $candidate.Namespace}}