次の方法で共有


New-AzGalleryInVMAccessControlProfileVersion

新しいバージョンのギャラリーを inVMAccessControlProfile に作成します。

構文

Default (既定)

New-AzGalleryInVMAccessControlProfileVersion
    -ResourceGroupName <String>
    -GalleryName <String>
    -GalleryInVMAccessControlProfileName <String>
    -GalleryInVmAccessControlProfileVersion <PSGalleryInVMAccessControlProfileVersion>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

説明

New-AzGalleryInVMAccessControlProfileVersion コマンドレットは、Azure に新しいバージョンのギャラリー inVMAccessControlProfile を作成します。
このコマンドレットは、 New-AzGalleryInVMAccessControlProfileVersionConfig から作成された PSGalleryInVMAccessControlProfileVersion オブジェクトを 入力として受け取ります。

Add-AzGalleryInVMAccessControlVersionRulesIdentityAdd-AzGalleryInVMAccessControlVersionRulesPrivilegeAdd-AzGalleryInVMAccessControlVersionRulesRoleおよび Add-AzGalleryInVMAccessControlVersionRulesRoleAssignment コマンドレットを使用して、PSGalleryInVmAccessControlProfileVersion オブジェクトにルールを追加することもできます。

例 1

New-AzGalleryInVMAccessControlProfileVersion -ResourceGroupName "myResourceGroup" -GalleryName "myGallery" -GalleryInVMAccessControlProfileName "myProfile" -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion

ギャラリーのバージョンを INVMAccessControlProfile に作成します。

例 2

$rgname = "myResourceGroup"
$___location = "West US 2"
$galleryName = "myGallery"
$inVMAccessProfileName = "myProfile"
$inVMAccessProfileVersionName = "myProfileVersion"

# Create a gallery
New-AzGallery -ResourceGroupName $rgname -GalleryName $galleryName -Location $___location -Description "My custom image gallery"

# Create a gallery inVMAccessControlProfile
New-AzGalleryInVMAccessControlProfile -ResourceGroupName  $rgname -GalleryName $galleryName -GalleryInVMAccessControlProfileName $InVMAccessControlProfileName -Location $___location -OsType "Windows" -ApplicableHostEndPoint "WireServer"

# Create a gallery inVMAccessControlProfile version config
$inVMAccessControlProfileVersion = New-AzGalleryInVMAccessControlProfileVersionConfig -Name $inVMAccessControlProfileVersionName -Location $___location -Mode "Audit" -DefaultAccess "Deny" -TargetLocation @("Wesut US2", "West US") -ExcludeFromLatest

# Add rules to PSGalleryInVMAccessControlProfileVersion
Add-AzGalleryInVMAccessControlProfileVersionRulesPrivilege -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -PrivilegeName "GoalState" -Path "/machine" -QueryParameter @{ comp = "goalstate" }
Add-AzGalleryInVMAccessControlProfileVersionRulesRole -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -RoleName "Provisioning" -Privilege @("GoalState")
Add-AzGalleryInVMAccessControlProfileVersionRulesIdentity -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -IdentityName "WinPA" -UserName "SYSTEM" -GroupName "Administrators" -ExePath "C:\Windows\System32\cscript.exe" -ProcessName "cscript"
Add-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -Role "Provisioning" -Identity @("WinPA")

# Create the gallery inVMAccessControlProfile version resource in Azure
New-AzGalleryInVMAccessControlProfileVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryInVMAccessControlProfileName $inVMAccessProfileName -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion

最初にギャラリーと InVM Access Control Profile を作成し、次にルールを使用してローカル プロファイル バージョン構成を構築し、最後に Azure にデプロイすることで、完全な InVM アクセス制御プロファイルのセットアップを作成します。

パラメーター

-Confirm

コマンドレットを実行する前に確認を求めるメッセージが表示されます。

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:cf

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DefaultProfile

Azure との通信のために使用される資格情報、アカウント、テナント、サブスクリプションです。

パラメーターのプロパティ

型:IAzureContextContainer
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-GalleryInVMAccessControlProfileName

VM アクセス制御プロファイル内のギャラリーの名前。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-GalleryInVmAccessControlProfileVersion

New-AzGalleryInVMAccessControlProfileVersionConfig から作成された PSGalleryInVmAccessControlProfileVersion オブジェクト。

パラメーターのプロパティ

型:PSGalleryInVMAccessControlProfileVersion
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-GalleryName

ギャラリーの名前。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-ResourceGroupName

リソース グループの名前。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-WhatIf

コマンドレットを実行した場合の動作を示します。 コマンドレットは実行されません。

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ウィスコンシン

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。

入力

String

PSGalleryInVMAccessControlProfileVersion

出力

PSGalleryInVMAccessControlProfileVersion