User Profile
hkarthik_7
Copper Contributor
Joined 5 years ago
User Widgets
Recent Discussions
Re: powershell to run git commit using PAT in Azure github pipelines
Hello SBVRaja, Please try to run it locally and check if it is working. Make sure to that you have created a service connection in Azure DevOps. And the other possibility is that it could be due to the url, you can refer the documentation for git push here.6.9KViews0likes0CommentsRe: Deploying VM Using ARM Template
Hi Antwaynio97 , this is because there are no parameters like -adminUsername, -adminPassword and similar values to the cmdlet New-AzResourceGroupDeployment. You have to specify the admin username for VM in the parameters template and save your password in Azure key vault and refer the URL to the secret in password section. Please specify all the certificates related values, SKU size of the VM, admin username, password, location and encapsulate everything in a parameters file. Then, you can run the cmdlet like New-AzResourceGroupDeployment -ResourceGroupName "ContosoEngineering" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json" Please run "help New-AzResourceGroupDeployment -Full" to know the complete usage of cmdlet. You can export the template and parameter files, edit them according to your need and use the command to deploy.2.4KViews1like0CommentsRe: Deploying VM Using ARM Template
Hello Antwaynio97, You are passing the password as a plain text. Rather convert it to a secure string and try again. Something like this - New-AzResourceGroupDeployment ` -Name "dplisvvm$postfix" ` -ResourceGroupName "$rgName" ` -TemplateFile "VHDtoImage.json" ` -userStorageAccountName "$storageaccount" ` -dnsNameForPublicIP "$vmName" ` -subscriptionId "$mysubid" ` -location "$location" ` -vmName "$vmName" ` -vaultName "$kvname" ` -vaultResourceGroup "$rgName" ` -certificateUrl https://vaulto.vault.azure.net/keys/Arthur/cf9ba64e6bb24adfa943ed9d5ab72ce0.Id ` -vhdUrl "$vhdUrl" ` -vmSize "Standard\_A2" ` -publicIPAddressName "myPublicIP1" ` -virtualNetworkName "myVNET1" ` -nicName "myNIC1" ` -adminUserName "Aruzki19" ` -adminPassword ("Antwaynio97101#" | ConvertTo-SecureString -AsPlainText -Force)2.5KViews0likes2CommentsRe: PowerShell script for enabling user in AD via thier employee id or username
Hi james_teach256, User accounts can be enabled with the SamAccountNames. You can place the SamAccountNames in a text file and execute the below script to enable the user accounts in bulk. Also, note that this should be executed from a domain controller. Import-Module ActiveDirectory # Place all the SamAccountNames in a text file (Get-Content "C:\TEMP\ADUsers.txt") | ForEach-Object { Enable-ADAccount -Identity $_ }1.6KViews0likes0CommentsRe: Create a htmt report with color
Hi Sekhar7590, you can save the below script in a .ps1 file and run it. This spits the output to a html file and highlights all processes which are running for more than 5 hours in red. Hope this helps. #region build html report $Html = " <HTML> <TITLE> LONG RUNNING PROCESSES </TITLE> <BODY background-color:peachpuff> <font color =""#B03A2E"" face=""Microsoft Tai le""> <H1> LONG RUNNING PROCESSES </H1> </font> <Table border=1 cellpadding=3 cellspacing=3><br> <TR bgcolor=#A9CCE3 align=center> <TD><B>Name</B></TD> <TD><B>Start Time</B></TD> <TD><B>Id</B></TD> <TD><B>Paged Memory Size</TD></B> <TD><B>Virtual Memory Size</TD></B> <TD><B>Path</TD></B> <TD><B>CPU</TD></B> <TD><B>Virtual Memory Size 64</TD></B> </TR> " #endregion build html report # detect processes running more than 5 hours foreach ($proc in (Get-Process)) { $Html += "<TR><TD align='center' >$($proc.Name)</TD>" If($proc.StartTime -lt (Get-Date).AddHours(-5)) { $Html += "<TD align='center' bgcolor=#EC7063>$($proc.StartTime)</TD>" } else { $Html += "<TD align='center'>$($proc.StartTime)</TD>" } $Html += "<TD align='center' >$($proc.Id)</TD>" $Html += "<TD align='center' >$($proc.PagedMemorySize)</TD>" $Html += "<TD align='center' >$($proc.VirtualMemorySize)</TD>" $Html += "<TD align='center' >$($proc.Path)</TD>" $Html += "<TD align='center' >$($proc.CPU)</TD>" $Html += "<TD align='center' >$($proc.VirtualMemorySize64)</TD>" } # save the report in current directory $Html | Out-File .\proc.html1.1KViews0likes0Comments
Groups
Recent Blog Articles
No content to show