AzureRM Add-AzureRmADGroupMember failing - powershell

I am trying to add a service principal from a Web App (Managed Service Identity) in to an Azure AD group and can't figure out why I am getting an error. I am using AzureRM 6.0.1. Any idea where I may be going wrong?
PowerShell Command:
Add-AzureRmADGroupMember -MemberObjectId 3cc2d09c-4fd4-4251-aa42-9ad6a0440606 -TargetGroupObjectId 2ca727c0-e2ec-46d4-9202-2144d83eb6b5 -PassThru
Error:
Add-AzureRmADGroupMember : The URI
'https://graph.windows.net//Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureTenant/directoryObj
ects/3cc2d09c-4fd4-4251-aa42-9ad6a0440606' is not valid since it is
not based on
'https://graph.windows.net/fdfed904-9e03-4e17-89c4-61053e0777be/'. At
line:2 char:2
+ Add-AzureRmADGroupMember -MemberObjectId 3cc9d09c-4fd4-4251-aa42-9ad ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-AzureRmADGroupMember], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.AddAzureADGroupMemberCommand

Related

Installing CCM client on PC via powershell

I'm trying to speed up how soon SCCM recognises a device on the domain and starts the process of installing applications.
I have the below in powershell
$CCMInstallerPath = "\\ServerFQDN\SMS_MAN\Client\ccmsetup.exe"
$args = "/mp:MPServer", "/LOGON", "/UsePKICert", "SMSSLP=SMSSLPServer", "SMSSITECODE=MAN"
& $CCMInstallerPath $args
I get the below error:
Program 'ccmsetup.exe' failed to run: Access is deniedAt line:1 char:5
+ & $CCMInstallerPath $args
+ ~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:5
+ & $CCMInstallerPath $args
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
I have read and execute access to this file, both by group and directly by name
I have also tried:
Start-Process -FilePath \\ServerFQDN\SMS_MAN\Client\ccmsetup.exe -ArgumentList "/mp:MPServer", "/logon SMSSITECODE-MAN", "/UsePKICert"
and get the error
Start-Process : This command cannot be run due to the error: Access is denied.
At line:1 char:5
+ Start-Process -FilePath \\ServerFQDN\SMS_MAN\Client\c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
ServerFQDN is a replacement for one of our NM servers
I can fully connect to the folder and run the exe manually
I am running elevated powershell
Issue was caused by incorrect share permissions found in effective access.
Permission was granted to run the file but effective access was showing differences

I have a problem with "Create an Azure AD App" Specifically with the powershell Script "Create-AADIdentityApp.ps1"

I have installed Azure stack development kit and i am trying to install the App service.
Then when i have to run the PS1 script Create-AADIdentityApp.ps1 i fill in the following parameters
DirectoryTenantName
AdminArmEndpoint
TenantArmEndpoint
CertificateFilePath
Then i get the following error
New-Object : Exception calling ".ctor" with "3" argument(s): "The system cannot find the file specified.
"
At C:\app-service-certificate-install\Create-AADIdentityApp.ps1:81 char:24
+ ... rtificate = New-Object System.Security.Cryptography.X509Certificates. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
does anyone have any experience?
You provided a invalid CertificateFilePath.
It should be Full path to the identity application certificate file generated earlier.
Please check and correct it.

Connecting Skype for Business with ChatBot

I am trying to deploy Bot on skype and facing this error,
Could anyone please suggest the solution for the same:
PS C:\WINDOWS\system32> $TenentAdminDomainId = Read-Host -Prompt 'Input your domain id in <user>#<domain>.com'
Input your domain id in <user>#<domain>.com: test2#botwork.onmicrosoft.com
PS C:\WINDOWS\system32> New-CsOnlineApplicationEndpoint -ApplicationId fc1d28c4-7ff2-41dd-9a1b-a5652949d051 -Name TestBotAP -Uri sip:$TenentAdminDomainId
Cmdlet invocation error
+ CategoryInfo : NotSpecified: (:) [New-CsOnlineApplicationEndpoint], CmdletInvocationException
+ FullyQualifiedErrorId : Error processing cmdlet request,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : adminin1.online.lync.com
Could not find the application endpoint
+ CategoryInfo : InvalidOperation: (Microsoft.Rtc.M...cation endpoint:PlatformServiceCmdletException) [New-CsOnlineApplicationEndpoint], PlatformServiceException
+ FullyQualifiedErrorId : Could not get application endpoint or the Uri is already present as an User in BVD,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet
+ PSComputerName : adminin1.online.lync.com
From https://learn.microsoft.com/en-us/skype-sdk/skype-for-business-bot-framework/docs/bot-common-errors
FullyQualifiedErrorId : Could not get application endpoint or the Uri
is already present as a User in BVD
Delete the existing user account with the same sipuri in tenant, or
run the cmdlet using a sipuri that does not already exist in the
tenant.

Having issues when migrating asm vm's into arm

When am trying to migrate 2 vm's inside a vnet (ASM Deployment), I am getting an error on prepare statment I am running the simple command to migrate a vnet which contains 2 vms the commandc
$vnetName = "ASMTOARM"
Move-AzureVirtualNetwork -Prepare -VirtualNetworkName $vnetName
I am using the latest version of powershell, now the error which I am getting:-
Move-AzureVirtualNetwork : XrpVirtualNetworkMigrationerror. : Template DC-1-Template deployment failed.
CorrelationId=a273db43-6920-49a6-b6d5-45d91cbac676
At line:1 char:1
+ Move-AzureVirtualNetwork -Prepare -VirtualNetworkName $vnetName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Move-AzureVirtualNetwork], ComputeCloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Network.MoveVirtualNetworkCommand

Issues while running Register-ELBInstanceWithLoadBalancer on powershell

I am trying to add existing Windows Instances to and ELB using below command on powershell :-
Register-ELBInstanceWithLoadBalancer -LoadBalancerName ire798ELB
-Instances i-2eb0a88d -Region us-east-1a
But it is giving me below error :-
Register-ELBInstanceWithLoadBalancer : A WebException with status
ConnectFailure was thrown. At line:1 char:1
+ Register-ELBInstanceWithLoadBalancer -LoadBalancerName ire798ELB -Instances i-2e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...dBalancerCmdlet:RegisterELBInst...dBalancerCmdlet)
[Register-ELBInstanceWithLoadBalancer], InvalidOperationException
+ FullyQualifiedErrorId :
Amazon.Runtime.AmazonServiceException,Amazon.PowerShell.Cmdlets.ELB.RegisterELBInstanceW
ithLoadBalancerCmdlet
I tried searching on the net but could not find anything helpful. Can anyone here help me with this please.
Your -Region parameter isn't correct. 'us-east-1a' is an availability zone within the us-east-1 region.