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

Read two different arrays and display

I have a text file, which has 1000 of entries in the way mentioned below:KozoscustomersabzeemployeeI am reading the content of text file and saving as an arrays.$global:Content = get-content info.txt...

View Article


file removal by force

Hi,if i want to remove file forcefully, which means, even though file is being used, but it won't complain or ask before remove, what i should be using after Remove-Item "c:\files\test1.txt"?

View Article


Copying files from folder with a filter.

Hey Guys,I've got a folder on a share with files in it. I need to copy files with certain extensions, to a set of remote folders. I've got the routine to copy to multiple shared, but the problem that...

View Article

Get-ADObject giving errors

I have a little bit of knowledge in using PowerShell but have very long way to go.  I am trying to use the Get-ADObject command but having problems. Using this command(also with all possible parameters...

View Article

PowerShell 2.0 & Modules

I have a scenario where I want/need toModularize my code, so that bits and pieces can be updated easily over time.Store those bits and pieces on a network and access them using UNC pathsExecute the...

View Article


how can check groups are exist in active directory with powershell

Hi FriendsI have group list in notepad file or CSV file .. I need to check if all listed group in file are exist in AD or not..Please help me or guide meI tried something like below but could not get...

View Article

How to use nested C# classes in PowerShell?

$sA=@'  public class A {    public string s1;   public class B {     public string s2;   } }'@Add-Type-TypeDefinition$sA-IgnoreWarnings$A=New-Object A$A.s1='aaaaaa';Write-Host$A.s1Write-Host...

View Article

ADD-computer with -newname and joinwithnewname option

Hi,I've been looking for a way to add a server to a domain after renaming it (without reboot in between). All the existing threads I've found were not solved, at least not with the powershell command...

View Article


Add-Computer to domain with new name returns error

Hi Folks:I am writing a script that configures servers and joins them to a domain. Near the end of the script I've added the command,Add-Computer -DomainName 'domainname' -Credential (Get-Credential...

View Article


Why won't my ntdsutil command execute successfully from my Posh script?

Hello,The purpose of the script is to delete snapshot versions using ntdsutil.The script starts and executes a  '$SnapShotList = ntdsutil snapshot "list all" quit quit' to list current snapshots as...

View Article

Get Serial Number and Hostnames !

Hello All,I need to list names and serial numbers of all the PCs which are part of my domain and save them in a csv format. Could someone please help me with a simple PowerShell script to accomplish it...

View Article

Powershell DSC(Desired State Configuration) staggered configuration

I'm currently planning on using Powershell DSC to synchronize a IIS web server farm and i need to be able to do a staggered configuration on nodes so it does not affect availability. For now i only...

View Article

foreach - if statement help

HiI'm creating a script to get names of computers in ad, pinging the clients etc.I need some help on weeding out specific machines..without the 'weeding out' the script looks like this: (snippet of the...

View Article


Powershell Script to import photos

Hi,Im fairly new to powershell but am looking to create a script which can look in a directory of photos which are namedsamaccountname.jpg. What I want to do is run a script which looks at the...

View Article

Launch IE11 in IE10 developer mode with powershell?

When accessing a certain page for testing which requires IE 9+ doesnt seem to work correctly with IE11. However, If I use Emulation and a user agent string for IE 10 I can access the website perfectly...

View Article


creat custom table

Hi, Please, i need your help to create tables for the screen and/or to print. I have us xml file. The probleme is, how i get the page-length/ligne-number/items On the end i would transform this scripte...

View Article

Isolate two values from a text file

I have a text file Information.txt which has values like:-Name Type IPabc elite  10.0.0.1def  gold 10.0.0.2ghi  silver 10.0.0.3$global:Content = get-content Information.txt Function ExtractIP($String)...

View Article


Image may be NSFW.
Clik here to view.

Setting colors in powershell graph?

Hello, I have just started using powershell to create some quick presentable graphs that monitor drive space. I have a few bar charts and a Pie chart.Is it possible to set colors for each individual...

View Article

Image may be NSFW.
Clik here to view.

Is there a way to rearrange Advanced Network Setting in Windows 7?

We recently deployed CUCI-Lync and have come across a situation where CUCI-Lync will not load on those laptops that have the Cisco VPN Client installed.  Long story, short - the solution was to go to...

View Article

Script signing stopped working in domain

Until recently I had code signing set up and working in our domain but recently I've encountered the infamous UnknownError in every attempt to sign a ps1 script despite my confirming without a doubt...

View Article
Browsing all 21975 articles
Browse latest View live