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

Image may be NSFW.
Clik here to view.

Get-AzureVM went wrong

I have installed Azure Powershell Module, and I have import azurepublishsettingfile , I can get my subscribtion with get-azuresubscritpion. But when I run "get-azurevm" ,there is an error pop...

View Article


Usage of Set-DNSServerSetting

Hello all togehter,I have severall Windows 2012 DCs with DNS installed. Until now, I use a batch file to configure the DNS for my demands. Since 2012, I can configure DNS with PowerShell and I want to...

View Article


Extracting Event Logs into a CSV file/ txt file or to html page

Hi all, I am working on a Powershell Script, to extract event logs to a txt file, csv file or even a html page, although i have a few problems, and i am new to powershell and need to understand some...

View Article

Powershell changes xml even if not asked to

Im reading an xml file into powershell xml variable. Originally I was modifying some values in the file, and saving it back out, but found the app that uses the file was discarding it as it found...

View Article

Get-ADuser Help

Hi, i have a list of Userhome folders in a server so i need to delete the ones where the users in AD are disabled or are in a specific leavers OU. But i got something wrong with my code.First i get the...

View Article


Use Same Excel Object in Start-Job as Main PS1

I have hundreds of Excel files and one main file that has links to each of these files, but in order for the data to be pulled into the main excel file I need to have every file opened within the same...

View Article

Export event 307 to .csv (print server)

Hi there,I'm starting to work with PS and I need some help.I've found some scripts to export 307 event from print server but none is working for me.When I run the code below, I got:Get-WinEvent : No...

View Article

A self documenting DSC Configuration wich contains all Resources

One funny thing with PowerShell is allways: It can document himself. Inspired by Steven Murawskis video on Desired State Configuration (DSC) I have done a full Blowen full self documenting DSC...

View Article


Set default printer $CheckBox with powershell

Hey I was hoping someone could help me out with this. I am building a GUI to add a printer and giving it a check box to set it to the default.  Everything is working correctly except that when it set...

View Article


It is possible to install updates using PStools PsExec?

I have some updates in .Cab files that need to be applied to remote servers manually (W2K03, 08).I was looking to see if PsExec could be used to simplify this task so I tired this but it doesn't error...

View Article

Rename Filename removing end-part

Hi, I have around 200 txt files in a directory, all files have a "_" and a datestamp in the end of the filename. Is there any single-line command available that i can use to eliminate the "_" +...

View Article

Test WebServices from Powershell

Hi Users,First thz for read the article and try to help me. I found some test webservice, but all only test port not the webservices. I am interesting to test a webservice (different method of...

View Article

manage "Change PC settings" in Win 8.1 using PS

how to manage "Change PC settings" -> Privacy in Win 8.1 using Powershell. Thanks.-ss

View Article


change desktop background for clients

Hy,I'm trying to write a script for a GPO to set a default background for a OU. This is what i came up whith: PS C:\> new-gpo -name WP_ICT3 |new-gplink -target "ou=All_ICT,DC=WD,DC=local" |...

View Article

How to filter multiple conditions with Get-ADComputer?

Hello,The goal is to include all computer objects in an OU, then 'exclude' a few.  How do I exclude multiple computer objects using -Filter as follows:Get-ADComputer -Filter "SamAccountName -ne...

View Article


Mount-DiskImage in a remote session exeception- Cannot process Cmdlet...

Hi everybody,I have a strange problem with Mount-DiskImage command.Environment: Windows server 2012 without any updates.All scripts signed as it was in Hanselman's...

View Article

How to use ForegroundColor with Read-Host in while loop?

I'm prompting for an optional action (amidst other output) like this:$question = "Create Software Inventory Report? [y|n]" $answer = "" while ($answer -notmatch "[y|n]") { $answer = Read-Host $question...

View Article


set wallpaper using OU-policy

Hy, I'm trying to write a script for a GPO to set a default background for a OU. This is what i came up whith:PS C:\> new-gpo -name WP_ICT3 |new-gplink -target "ou=All_ICT,DC=WD,DC=local" |...

View Article

How to reset array position pointer

I have an array that I use a foreach to cycle through. I then need to cycle through the same array again. How do I reset the pointer for the array so I'm at the beginning again?

View Article

listing AD accounts that been inactive for more than 90 days, or that shows...

Hi, I am trying to get information about more than 90 days, could someone verify script below, is it fine or I should add anything else$90Days = (get-date).adddays(-90)Get-ADUser -properties * -filter...

View Article
Browsing all 21975 articles
Browse latest View live


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