it's supposoed to work with this commandlet
Get-CalendarDiagnosticObjects
but it's obviously missing from these modules
3.0.0 ExchangeOnlineManagement PSGallery This is a General Availability (GA) release of the Exchange Online Powershell V3 module....
0.11.0 ExchangePowerShell PSGallery The EP (ExchangePowerShell) Powershell module is a collection of commandlets that can be
The term 'Get-CalendarDiagnosticObjects' is not recognized as the name of a cmdlet,
whereas:
Connect-ExchangeOnline
get-mailbox
works fine!
seems that V3 of the module is quite new? any idea?
Related
I can invoke Find-Module without the -Credential argument and it works just fine. This is because:
the module in question is found on an on-prem NuGet repo in the Windows Domain
the default authentication is NTLM
Now I really want to use PAT, which forces me to pass the -Credential argument. However, in order to work the authentication must be switched to Basic. And this is where I am stuck.
I know how to configure the NuGet source with the PAT credentials (and ValidAuthenticationTypes = basic), so I am able to use nuget.exe with PAT. But I specifically need Find-Module (and Install-Module) to work.
This happens both on Windows Powershell and on PS Core. Here is Get-Module output on PS Core:
C:\Users\p11f70f> get-module
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-It…
Manifest 7.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString…
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Ob…
Script 1.4.8.1 PackageManagement {Find-Package, Find-PackageProvider, Get-Package,…
Script 1.0.0 Posh-Git {Add-PoshGitToProfile, Expand-GitCommand, Format-…
Script 2.2.5 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Fin…
Script 2.1.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, …
C:\Users\p11f70f>
Using ILSpy I traced the execution of the Find-Module and my conclusion is that it is impossible to make it work with PAT if the server prefers NTLM.
This is quite frastrating, because some PS flows use in-house logic to interact with the NuGet server (like Find-Module and Install-Module) yet other flows fallback to dotnet.exe nuget or nuget.exe (like Publish-Module)
The latter recognize the PAT credentials saved in the $env:APPData\NuGet\NuGet.config file and the most importantly respect the validAuthenticationTypes property which forces them to override NTLM with Basic authentication.
The in-house PS logic does nothing of the kind. Moreover, it gets poisoned by the saved PAT credentials, which would be used with NTLM, which is totally wrong.
What a mess.
I've run into an error after following this document (https://learn.microsoft.com/en-us/graph/cloud-communication-online-meeting-application-access-policy) when trying to set up an application access policy in powershell. This is the cmdlet that was run, which produced the error,
New-CsApplicationAccessPolicy -Identity "MeetingsPolicy" -AppIds "<app-id>" -Description "MeetingsPolicy"
The error received in powershell is the following,
"New-CsApplicationAccessPolicy : Unable to cast object of type 'System.Management.Automation.PSListModifier' to type
'System.String'."
Can anyone help shed any light on what is the problem here and how to fix it please?
P.S Im using Powershell 5.1 on Win 10 and running Powershell in admin mode.
Have also tried the following using "splatting", which also did not work.
$props = #{
identity = 'MeetingsPolicy'
appids = '<app-id>'
description = 'MeetingsPolicy'
}
New-CsApplicationAccessPolicy #props
So it turned out the Microsoft Teams cmdlet module version 3.1.0 has issues in there when installed with no previous version. I had to install the 2.3.2-preview version first, which allowed the cmdlets to work. I then updated this version to 3.1.0 and it works fine.
So the steps you need to take are the following,
i) Remove the teams module from powershell,
Uninstall-Module MicrosoftTeams -Allversions
ii) Install the older version first,
Install-Module -Name MicrosoftTeams -RequiredVersion 2.3.2-preview -AllowPrerelease
iii) Connect to teams
Connect-MicrosoftTeams
v) Update to the latest version (Optional)
Update-Module -Name MicrosoftTeams
Run cmdlet and it should work now.
Credit to Marcus Rath for his post here https://blog.matrixpost.net/teams-powershell-several-cmdlet-doesnt-work-errounable-to-cast-object-of-type-system-management-automation-pslistmodifier-to-type-system-string/, which explains the issue in more detail.
I am having some issues using this ps script. Would you please explain what are the Permissions/rights are prerequisites to run the ps script.At the same time is it mandatory to have Azure Subscription? I have an Azure account under my organization's tenant Name. But in my account I dont see any subscription ID. I created an app from Menu>Azure Active Directory> APP Registration. Then got permission granted for the below two with the help of O365 Admin of my organization: Reports.Readers.all
User.Read
I have "Readers Role ". Is it sufficient to run those script to have O365 usages report, teams usage Report and all other reports mentioned in the link you shared above? Please help me out to resolve this. I am struggling with this for couple of weeks without any luck! :(
My powerShell version is 5.1.
When i am running the PS script I am getting error:(this is the script: https://gallery.technet.microsoft.com/Get-Office365-usage-f955ade4)
WARNING: Unable to load ADAL assemblies.
Update the MSOnline module by running Install-Module MSOnline -Force -AllowClobber
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Program
Files\WindowsPowerShell\Modules\MSOnline\1.1.183.57\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll' or one of its dependencies. The system cannot find the file
specified."At C:\Users\MRAHM11\Documents\Projects\O365_Usage_PowerShell\Script_DwnLd\Get-Office365Report.ps1:256 char:21
[System.Reflection.Assembly]::LoadFrom($adalforms) | Out- ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : FileNotFoundException
When I am executing PS> Install-Module MSOnline -Force -AllowClobber
Getting error:
WARNING: The version '1.1.183.57' of module 'MSOnline' is currently in use. Retry the operation after closing the applications.
What are the wrong steps I am taking?
Is my user permission is okey or need to have different user role like Global Reader or something else?
Please help..
Your issue is related to ADAL dll loading in MSOnline powershell module, not any permission so far as you have not reached to that point yet. But note that MSOnline is older V1 PowerShell module for Azure Active Directory which uses deprecated ADAL library. I suggest you NOT to use MSOnline anymore. Customers are encouraged to use the newer Azure Active Directory V2 PowerShell module* instead of this module. For details, refer Use PowerShell to create reports for Microsoft 365.
Install-Module -Name AzureAD
For newer V2 based script for O365 usage report, please refer https://gallery.technet.microsoft.com/Get-O365UsageReports-954fb5a3
*v2 doesn't require -AzureTenantADName or ADAL dlls.
Regarding permissions, Reports.Read.All is good enough.
Details on working with the Office 365 Usage reports via Microsoft Graph API: https://developer.microsoft.com/graph/docs/api-reference/v1.0/resources/report
Details on working with the Office 365 Usage reports via beta API in Microsoft Graph: https://developer.microsoft.com/graph/docs/api-reference/beta/resources/report
*beta API has some additional Teams reports API.
First try removing those modules..
Remove-Module -Name "MSOnline" -force
Uninstall-Module -Name "MSOnline" -AllVersions -force
and then install
Install-Module MSOnline -Force -AllowClobber
I am trying to install the sysinternals package with powershell, but is instead greeted with tons of warnings. It should be noted that I am following a set of instructions and don't know a lot about this subject yet. Here are the warnings when attempting to run the install-package command:
Install-Package sysinternals
WARNING: NuGet: System.InvalidOperationException: Unable to find version '1.3.5.1' of package 'chocolatey-core.extension'.
WARNING: NuGet: at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository
localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version, Boolean
allowPrereleaseVersions)
WARNING: NuGet: at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies,
Boolean allowPrereleaseVersions)
WARNING: NuGet: at NuGet.Commands.InstallCommand.InstallPackage(IFileSystem fileSystem, String packageId, SemanticVersion version)
WARNING: NuGet: at NuGet.Program.Main(String[] args)
WARNING: NuGet: System.InvalidOperationException: Unable to find version '2019.12.19' of package 'sysinternals'.
As for what I've done before this, I've only installed the Chocolatey package provider and updated windows, but maybe I did something wrong? Here are the steps leading up to this:
Set-ExecutionPolicy RemoteSigned
Install-PackageProvider Chocolatey
Install-Module -Name PSWindowsUpdate
Get-WUInstall -Verbose
Get-WUInstall -Install
Any help is much appreciated.
Though you can use Chocolatey and NuGet, PowerShell's package manager is PowerShellGet (well, that uses NuGet by design). So, Choco is not really needed, yet, many still install and use it for the other sources.
If you use PowerShellGet directly, you'll see the same errors.
Find-Module -Name 'SysInternals' -AllVersions |
Format-Table -AutoSize
<#
# Results
PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'SysInternals'. Try Get-PSRepository to see all available registered module
repositories.
At C:\Users\Daniel\Documents\WindowsPowerShell\Modules\PowerShellGet\2.2.3\PSModule.psm1:8873 char:9
+ PackageManagement\Find-Package #PSBoundParameters | Microsoft ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
#>
Find-Package -Name 'SysInternals' -AllVersions |
Format-Table -AutoSize
<#
# Results
Find-Package : No match was found for the specified search criteria and package name 'SysInternals'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Find-Package -Name 'SysInternals' -AllVersions |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
#>
Yet, if you do a wildcard search...
Find-Module -Name '*Internals*' |
Format-Table -AutoSize
<#
# Results
Version Name Repository Description
------- ---- ---------- -----------
1.0.34 PoshInternals PSGallery Collection of system internals tools for PowerShell.
4.3 DSInternals PSGallery The DSInternals PowerShell Module exposes several internal features of Active Directory and Azure Active Directory. These include FIDO2 and NGC key aud...
0.2.8 AADInternals PSGallery The AADInternals PowerShell Module utilises several internal features of Azure Active Directory, Office 365, and related admin tools. DISCLAIMER: Funct...
0.1 LCMInternals PSGallery Demo scripts explaining the internals of LCM
#>
Find-Package -Name '*Internals*' |
Format-Table -AutoSize
<#
# Results
Name Version Source Summary
---- ------- ------ -------
PoshInternals 1.0.34 PSGallery Collection of system internals tools for PowerShell.
DSInternals 4.3 PSGallery The DSInternals PowerShell Module exposes several internal features of Active Directory and Azure Active Directory. These incl...
AADInternals 0.2.8 PSGallery The AADInternals PowerShell Module utilises several internal features of Azure Active Directory, Office 365, and related admin...
LCMInternals 0.1 PSGallery Demo scripts explaining the internals of LCM
SilverlightToolkit-Internals-Unofficial 1.0.0 nuget.org The missing part of Microsoft Silverlight Toolkit. The internals DLL. 'System.Windows.Controls.Toolkit.Internals'
AppInternals.Agent.Cloud.Support 10.10.0 nuget.org Configure an Azure Cloud Service solution for AppInternals application performance monitoring.
InternalsVisibleTo.MSBuild 1.0.3 nuget.org Enables declaring 'InternalsVisibleTo' items in a .NET project file, rather than declaring them to an AssemblyInfo.cs file.
Akrual.DDD.Utils.Internals 1.0.8 nuget.org Useful Classes yo use everywhere
Meziantou.MSBuild.InternalsVisibleTo 1.0.1 nuget.org Allow to declare 'InternalsVisibleTo' in the csproj file, rather than declaring them to an AssemblyInfo.cs file.
microServiceBus.InternalService 1.0.0 nuget.org This package creates a stub from which you can create an Internal Service for microServiceBus.com
#>
So, as you can see, there is no such module/package called SysInternals to install.
What you do is just download the zip file from here and unpack and use it as normal.
Sysinternals Suite
https://learn.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
I was having the same issue and found the answer here helpful. It seems like something about TLS 1.3 is causing the issue, and the second part of the answer—changing the .Net Framework default TLS version—allowed me to finish my sysinternals install via PowerShell. Then I just deleted the new reg key I had created. I guess I'll just have to wait and see if this is something that comes up again as I continue to learn more and work more with package management in PS.
We have a set of custom powershell modules which use the Azure powershell cmdlets - they have been working fine for over a year. I just set up a new machine and whenever I try to run Get_AzureWebsite I receive the following error:
PS C:\WINDOWS\system32> Get-AzureWebsite 'anything'
Get-AzureWebsite : Requested value 'Dynamic' was not found.
This may just be a machine setup but am worried that these comdlets may be being deprecated - appreciate if anyone can help or knows how to fix this?
It may be fixed by updating the version of Azure PowerShell . More detail please refer to the issue and feedback. Please refer to how to install and configure Azure PowerShell. I didn't reproduce it on the Azure PowerShell v2.1.0. It works successfully.Please try to use the following code to get the current Azure PowerShell version .
(Get-Module -ListAvailable | Where-Object{ $_.Name -eq 'Azure' }) `
| Select Version, Name, Author, PowerShellVersion | Format-List;
Okay so this is versions of Azure and AzureRM cmdlets.
Working install is
Install-Module -Name AzureRM -RequiredVersion 1.3.2
Install-Module Azure -AllowClobber
Not sure about -AllowClobber but this was printed in the Azure Console....
PackageManagement\Install-Package : A command with name 'Get-AzureStorageContainerAcl' is already available on this
system. This module 'Azure' may override the existing commands. If you still want to install this module 'Azure', use
-AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1661 char:21
Guess there is a class in the Storage namespace or something
I installed the latest azure powershell and then ran again the script.
It worked fine.
Just to add you need to restart your machine after installing latest powershell, else you might face error "the required module Azure.Storage is not loaded"