Link to home
Create AccountLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell

I am running the latest Powershell version
I use the following command in an elevated powershell:

Install-Module AzureADPreview

I get the following error every time:
PackageManagement\Install-Package : The following commands are already available on this system:'Get-AzureADApplication
ProxyConnectorGroupMembers,Add-AzureADApplicationOwner,Add-AzureADDeviceRegisteredOwner,Add-AzureADDeviceRegisteredUser
,Add-AzureADDirectoryRoleMember,Add-AzureADGroupMember,Add-AzureADGroupOwner,Add-AzureADMSApplicationOwner,Add-AzureADM
SLifecyclePolicyGroup,Add-AzureADServicePrincipalOwner,Confirm-AzureADDomain,Connect-AzureAD,Disconnect-AzureAD,Enable-
AzureADDirectoryRole,Get-AzureADApplication,Get-AzureADApplicationExtensionProperty,Get-AzureADApplicationKeyCredential
,Get-AzureADApplicationLogo,Get-AzureADApplicationOwner,Get-AzureADApplicationPasswordCredential,Get-AzureADApplication
ProxyApplication,Get-AzureADApplicationProxyApplicationConnectorGroup,Get-AzureADApplicationProxyConnector,Get-AzureADA
pplicationProxyConnectorGroup,Get-AzureADApplicationProxyConnectorMemberOf,Get-AzureADApplicationServiceEndpoint,Get-Az
ureADContact,Get-AzureADContactDirectReport,Get-AzureADContactManager,Get-AzureADContactMembership,Get-AzureADContactTh
umbnailPhoto,Get-AzureADContract,Get-AzureADCurrentSessionInfo,Get-AzureADDeletedApplication,Get-AzureADDevice,Get-Azur
eADDeviceConfiguration,Get-AzureADDeviceRegisteredOwner,Get-AzureADDeviceRegisteredUser,Get-AzureADDirectoryRole,Get-Az
ureADDirectoryRoleMember,Get-AzureADDirectoryRoleTemplate,Get-AzureADDomain,Get-AzureADDomainNameReference,Get-AzureADD
omainServiceConfigurationRecord,Get-AzureADDomainVerificationDnsRecord,Get-AzureADExtensionProperty,Get-AzureADGroup,Ge
t-AzureADGroupAppRoleAssignment,Get-AzureADGroupMember,Get-AzureADGroupOwner,Get-AzureADMSApplication,Get-AzureADMSAppl
icationExtensionProperty,Get-AzureADMSApplicationOwner,Get-AzureADMSDeletedDirectoryObject,Get-AzureADMSDeletedGroup,Ge
t-AzureADMSGroup,Get-AzureADMSGroupLifecyclePolicy,Get-AzureADMSIdentityProvider,Get-AzureADMSLifecyclePolicyGroup,Get-
AzureADOAuth2PermissionGrant,Get-AzureADObjectByObjectId,Get-AzureADServiceAppRoleAssignedTo,Get-AzureADServiceAppRoleA
ssignment,Get-AzureADServicePrincipal,Get-AzureADServicePrincipalCreatedObject,Get-AzureADServicePrincipalKeyCredential
,Get-AzureADServicePrincipalMembership,Get-AzureADServicePrincipalOAuth2PermissionGrant,Get-AzureADServicePrincipalOwne
dObject,Get-AzureADServicePrincipalOwner,Get-AzureADServicePrincipalPasswordCredential,Get-AzureADSubscribedSku,Get-Azu
reADTenantDetail,Get-AzureADTrustedCertificateAuthority,Get-AzureADUser,Get-AzureADUserAppRoleAssignment,Get-AzureADUse
rCreatedObject,Get-AzureADUserDirectReport,Get-AzureADUserExtension,Get-AzureADUserLicenseDetail,Get-AzureADUserManager
,Get-AzureADUserMembership,Get-AzureADUserOAuth2PermissionGrant,Get-AzureADUserOwnedDevice,Get-AzureADUserOwnedObject,G
et-AzureADUserRegisteredDevice,Get-AzureADUserThumbnailPhoto,Get-CrossCloudVerificationCode,New-AzureADApplication,New-
AzureADApplicationExtensionProperty,New-AzureADApplicationKeyCredential,New-AzureADApplicationPasswordCredential,New-Az
ureADApplicationProxyApplication,New-AzureADApplicationProxyConnectorGroup,New-AzureADDevice,New-AzureADDomain,New-Azur
eADGroup,New-AzureADGroupAppRoleAssignment,New-AzureADMSApplication,New-AzureADMSApplicationExtensionProperty,New-Azure
ADMSApplicationKey,New-AzureADMSApplicationPassword,New-AzureADMSGroup,New-AzureADMSGroupLifecyclePolicy,New-AzureADMSI
dentityProvider,New-AzureADMSInvitation,New-AzureADServiceAppRoleAssignment,New-AzureADServicePrincipal,New-AzureADServ
icePrincipalKeyCredential,New-AzureADServicePrincipalPasswordCredential,New-AzureADTrustedCertificateAuthority,New-Azur
eADUser,New-AzureADUserAppRoleAssignment,Remove-AzureADApplication,Remove-AzureADApplicationExtensionProperty,Remove-Az
ureADApplicationKeyCredential,Remove-AzureADApplicationOwner,Remove-AzureADApplicationPasswordCredential,Remove-AzureAD
ApplicationProxyApplication,Remove-AzureADApplicationProxyApplicationConnectorGroup,Remove-AzureADApplicationProxyConne
ctorGroup,Remove-AzureADContact,Remove-AzureADContactManager,Remove-AzureADDeletedApplication,Remove-AzureADDevice,Remo
ve-AzureADDeviceRegisteredOwner,Remove-AzureADDeviceRegisteredUser,Remove-AzureADDirectoryRoleMember,Remove-AzureADDoma
in,Remove-AzureADGroup,Remove-AzureADGroupAppRoleAssignment,Remove-AzureADGroupMember,Remove-AzureADGroupOwner,Remove-A
zureADMSApplication,Remove-AzureADMSApplicationExtensionProperty,Remove-AzureADMSApplicationKey,Remove-AzureADMSApplica
tionOwner,Remove-AzureADMSApplicationPassword,Remove-AzureADMSDeletedDirectoryObject,Remove-AzureADMSGroup,Remove-Azure
ADMSGroupLifecyclePolicy,Remove-AzureADMSIdentityProvider,Remove-AzureADMSLifecyclePolicyGroup,Remove-AzureADOAuth2Perm
issionGrant,Remove-AzureADServiceAppRoleAssignment,Remove-AzureADServicePrincipal,Remove-AzureADServicePrincipalKeyCred
ential,Remove-AzureADServicePrincipalOwner,Remove-AzureADServicePrincipalPasswordCredential,Remove-AzureADTrustedCertif
icateAuthority,Remove-AzureADUser,Remove-AzureADUserAppRoleAssignment,Remove-AzureADUserExtension,Remove-AzureADUserMan
ager,Reset-AzureADMSLifeCycleGroup,Restore-AzureADDeletedApplication,Restore-AzureADMSDeletedDirectoryObject,Revoke-Azu
reADSignedInUserAllRefreshToken,Revoke-AzureADUserAllRefreshToken,Select-AzureADGroupIdsContactIsMemberOf,Select-AzureA
DGroupIdsGroupIsMemberOf,Select-AzureADGroupIdsServicePrincipalIsMemberOf,Select-AzureADGroupIdsUserIsMemberOf,Set-Azur
eADApplication,Set-AzureADApplicationLogo,Set-AzureADApplicationProxyApplication,Set-AzureADApplicationProxyApplication
ConnectorGroup,Set-AzureADApplicationProxyApplicationCustomDomainCertificate,Set-AzureADApplicationProxyApplicationSing
leSignOn,Set-AzureADApplicationProxyConnector,Set-AzureADApplicationProxyConnectorGroup,Set-AzureADDevice,Set-AzureADDo
main,Set-AzureADGroup,Set-AzureADMSApplication,Set-AzureADMSApplicationLogo,Set-AzureADMSGroup,Set-AzureADMSGroupLifecy
clePolicy,Set-AzureADMSIdentityProvider,Set-AzureADServicePrincipal,Set-AzureADTenantDetail,Set-AzureADTrustedCertifica
teAuthority,Set-AzureADUser,Set-AzureADUserExtension,Set-AzureADUserLicense,Set-AzureADUserManager,Set-AzureADUserPassw
ord,Set-AzureADUserThumbnailPhoto,Update-AzureADSignedInUserPassword'. This module 'AzureADPreview' may override the
existing commands. If you still want to install this module 'AzureADPreview', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

Please help - I have tried all sorts of connections to Azure but nothing helps
I need this to get Sensitivity Labels working
ASKER CERTIFIED SOLUTION
Avatar of DEMAN-BARCELO (MVP) Thierry
DEMAN-BARCELO (MVP) Thierry
Flag of France image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of doctorbill

ASKER

I don't understand
Is AzureAD the same as AzureADPreview?
Exactly what are the steps to uninstall and then re install
Uninstall AzureAD? then install AzureADPreview?
Do I then need to reinstall AzuerAD
AzureADpreview is simply a new version (but not final) of the AzureAD module.

If you have no dependency, you could use this command to uninstall before installing the preview:

unInstall-Module AzureAD
Just tried that
Makes no difference
Any update?

I tested on my machine this combination of commands:

Install-Module AzureAD
=> I have this warning : Version '2.0.2.128' of module 'AzureAD' is already installed. It indicates me the possible version 2.0.2.135.

Update-module AzureAD
=> this command should update 'to 2.0.2.135'

Install-Module AzureADpreview -AllowClobber
=> No error during this install
It installs but I get an error when running this:
Get-AzureADDirectorySettingTemplate
And what error do you get? and what is the command that you executed?
The command is not recognised
I am trying to get Sensitivity labels working in Azure
You didn't get this error message?
PS H:\Document

s\WindowsPowerShell\Scripts> Get-AzureADDirectorySettingTemplate
Get-AzureADDirectorySettingTemplate : You must call the Connect-AzureAD cmdlet before 
calling any other cmdlets.
At line:1 char:1
+ Get-AzureADDirectorySettingTemplate
+ ~~~~~~~~~~~

Open in new window


Did you first enable sensitivity labels?
https://docs.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels-sharepoint-onedrive-files?view=o365-worldwide
After installation of the Powershell modules, you have to quit the open Powershell, and reload a new Powershell context.

Get-AzureADDirectorySettingTemplate
Id                                   DisplayName                          Description
--                                   -----------                          -----------
08d542b9-071f-4e16-94b0-74abb372e3d9 Group.Unified.Guest                  Settings for a specific Unified Group
4bc7f740-180e-4586-adb6-38b2e9024e6b Application                          ...
Perfect - all working now
It looks like I needed to wait for an hour or 2 for the Powershell commands to take effect
Thanks all