Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Script to get usernames based on email address

Hello Everyone,We are having an issue with starting to clean up Active Directory in preparation for Azure AD Connect deployment. There are a number of user accounts that we do not need to sync...

View Article


PS query all windows servers in AD and specific services

Trying to write script that goes out against AD and does a get-adcomputer looking for any Windows Server operating system, then goes and looks at 3 specific NT service names Healthservice, MsMpSvc, and...

View Article


Matching Hostnames

Hello,I have a powershell script (below) which works fine when I ask it to look up IP addresses.. The only criteria I have changes is for it to match the hostname field in the CSV opposed to the...

View Article

taking a power shell cmdlet and changing it into script by importing from...

In my other post I was helped out on using the command...

View Article

Silent Install of .net 4.5 in powershell issue

Hi All, I am trying  to install dot netframework 4.5.2 on remote machine also getting 16389 error $DotNetInst="E:\temp\IE11andPowershellv4\NDP452-KB2901907-x86-x64-AllOS-ENU.exe" $process =...

View Article


MobileIron automation via API v2 in PowerShell

Dear Colleagues, I wonder if anybody have encountered challenge with automating Mobile Iron device provisioning ?I was told to use API v2 for mobile iron device enrollment, but i dont know how to...

View Article

Format a number with two decimals

I see there's a method for the Double type called .ToDecimal()I was wondering how that can be used. I am trying to output a number with lots of decimals to a number with only two decimals so that it...

View Article

Generate a GUI progress bar for DISM or ImageX

We are creating a custom recovery environment, and we're almost done. One of the last things we need to do generate a progress bar for either DISM or ImageX that simply displays the progress in a...

View Article


Image may be NSFW.
Clik here to view.

Get SQL Agent Job EnumHistory via Powershell

Hi guys!!I  am using Powershell through DollarU (Workload automation software) to execute SQL Agent job (all steps) or one specific step at a time.  So far so good, everything is working!!  However,...

View Article


Passing string array to function creates error

I am trying to call a function with the following parameter signature: Param ( [Parameter(Mandatory=$true)][string]$Subject, [Parameter(Mandatory=$true)][string]$JobResult,...

View Article

WMF 5 Prerequisites for Windows 7

Is it still necessary to install WMF 4 before installing WMF 5 on Windows 7 SP1 machines (PS Version 2.0)?  I thought that requirement was not supposed to be needed with the production release of WMF...

View Article

IndexOf - Case insensitivity errors

Can't seem to get the IndexOf overload to work to support case insensitive lookups.  Can you help me understand what I'm doing incorrect?$a = 'a','b','c'...

View Article

Need help with script to change local administrator password

Hi I am trying to create/run a script to change the local administrator password on a list of servers off of a text file. I have had no success and I thought this would be pretty easy. Below is the...

View Article


Creating SharePoint List from template using client runtime

I'm using the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies and I'm trying to create a list in SharePoint from a custom template I have created.The template info is as...

View Article

PowerShell ISE - NuGet-anyCPU Initialization Failed

I installed the module browser for the ISE but am unable to browse modules on the PowerShell gallery. When launching the ISE I receive a message indicating that the module browser requires...

View Article


Get-VM Details from Hyper-V Server

Dear All ,Could we get Hyper-V VMs Details like VMname,IP Address,operating system,CSV path, memory ,hard disk,virtual FC etc. in Cluster environment .Best Regards, Hussain

View Article

Remove-ADObject -- Access Is Denied

I have an array of computer objects which need to be deleted from Active Directory. This is going to be setup as a scheduled task, so I will not be able to interact with the script once it is fully...

View Article


Powershell to Inject Hostname into a Hyper-V based VM before Network...

Hello Team, I am looking for a powershell way of Injecting Hostname [Or lets say computer name rename] of a VM running on a Hyper-V Host. There is no Network Configuration on this VM, so PSremoting is...

View Article

Remove-Item Requested registry access is not allowed

Help please,I have written a Powershell script that is trying to use Remove-Item to delete some Registry keys. I am running under Admin. if I go into Regedit it will let me delete the keys but if I run...

View Article

Regular Expression for a string in a line

Hi Using PowerShell 5I have a text file:$mytextfile = get-content c:\myfile.txtThe file contains a lot of lines with text. I want to find all lines that have the words "catch me" in the text.Any...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>