-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
048a730
commit 04ef37e
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
#https://docs.microsoft.com/en-us/azure/storage/files/storage-files-identity-auth-active-directory-enable | ||
#Download AzFilesHybrid module from https://github.com/Azure-Samples/azure-files-samples/releases | ||
|
||
#Import AzFilesHybrid module | ||
Import-Module -name AzFilesHybrid | ||
|
||
#Register the target storage account with your active directory environment under the target OU | ||
join-AzStorageAccountForAuth -ResourceGroupName "RG-WCUS" -StorageAccountName "sawcusadfiles" ` | ||
-Domain "savilltech.net" -OrganizationalUnitDistinguishedName "OU=SPNs,DC=savilltech,DC=net" | ||
|
||
#Check healthy | ||
#Get the target storage account | ||
$storageaccount = Get-AzStorageAccount -ResourceGroupName "RG-WCUS" -Name "sawcusadfiles" | ||
#See the created kerberos key used by the AD account created | ||
$storageaccount | Get-AzStorageAccountKey -ListKerbKey | ft KeyName | ||
#List the directory service of the selected service account | ||
$storageAccount.AzureFilesIdentityBasedAuth.DirectoryServiceOptions | ||
#List the directory domain information if the storage account has enabled AD authentication for file shares | ||
$storageAccount.AzureFilesIdentityBasedAuth.ActiveDirectoryProperties | ||
|
||
#Computer object now present | ||
#Can set access control on files share, e.g. Storage File Data SMB Share Elevated Contributor | ||
|
||
New-PSDrive -Name "X" -PSProvider "FileSystem" -Root "\\sawcusadfiles.file.core.windows.net\data" -Scope Global | ||
Get-PSDrive x | Remove-PSDrive |