Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Browsing all 8411 articles
Browse latest View live

Can't delete folder recursively in script, no errors are printed.

I'm trying to remove a directory with a powershell script, the script seems to be working fine except for the deletion at the end. It's not printing out any errors so I'm not sure how to determine why...

View Article


Trying to find instance of item in array, -contains isn't working

I'm trying to write a script in Powershell that will match extensions of file names. This is what I have so far:$location = $args[0]; [String]$extensions = @(".mkv", ".mp4", ".avi", ".wmv"); $pruneSize...

View Article


Creating a PowerShell Script Gallery Upload Add-On – Part 1

One of the main features in the Script Browser is to search, download, and learn script examples from the TechNet Script Center.Read More

View Article

Fix RDP on Azure Virtual Machine

Q: I disabled RDP on my Azure virtual machine; how can I re-enable it?A: As long as your virtual machine has the Azure VM Agent installed, it's very simple to fix the RDP configuration on the virtual...

View Article

Using PowerShell to discover information about your Microsoft SQL Servers

I’m an infrastructure guy who supports many different products at multiple datacenters in an enterprise environment. One of those products is Microsoft SQL Server which I’ve been supporting since...

View Article


Would like to watch directory for changes

Hey everyone. I'd like to watch a directory for changes so that I can save the files in there to another location to back them up each time.So what I'm writing is a script that will start a process,...

View Article

Using -repalce to alter content of a variable

The script gets each mailboxes ProhibitSendQuota but as some of the mailboxes reside on Databases with storage limits set at the database level they return “Unlimited”. As a side note, I run this on an...

View Article

Modules and Runonce

Hi,I have a logon script that pin icons in the taskbar for users.The code for pinned icons use a module PinnedApplication.psm1.I have 4 servers for user connection so i have 2 questions :- The psm1 and...

View Article


Image may be NSFW.
Clik here to view.

Please help! Active Directory Security

I posted a question earlier about how to remove permissions for a specific user/group from an Active Directory OU. Based on the help I got here, I was able to come up with a script. Now my script...

View Article


Script of Software Inventory

Hello my peers     Need powershell script that checks which softaware be installed on the machines in the network via the windows registry and get back to me in a file the software installed. And that...

View Article

Get-AdComputer just name

I have this code that works  Get-ADComputer -Filter * | Format-List name   but it returns the following:  name : MG08157 name : MG08151 name : MG08155 name : MG07962 name : MG09233 name : MG09270 I...

View Article

Clear connections to the print server

We have a newprint serverandwant to runa scriptonall clientsvia GPO.Itshould beall connections to theoldprint serverdeleted.$oldPrinterName = "\\Server01\"$comNetwork = New-Object -ComObject...

View Article

Script to Query AD for List of Software

Hi All , newbie here.I have following script to query AD, get list of PC/servers that match filter ( operating system) , do a ping test and if successful will prompt to enter name of software to search...

View Article


Audio volume

friends,how do Icontrol theaudio volume(the overall volumeandMedia Player)?

View Article

Script that shows specific user is logged into a list of servers. The script...

The script below lists all users that have open RDC sessions on a list of servers.I need it to just list any from a specific person. Could anyone help... $servers = get-content “C:\scripts\servers.txt”...

View Article


Powershell v2. Delete or Remove Lines of Text. Regex Issue.

Hi All,First time posting and very new to PS. Please be gentle ;)I've been through so many posts today that offer Powershell examples of how to remove entire lines from a file by using line numbers....

View Article

.key and .crt certificate conversion to .pem format in PowerShell

Hello, During my work with openssl I came across a problem related to entity certificate and key conversion in .crt and .key format to .pem which is required by my application. Is there any possiblity...

View Article


How to add Details to First name & Last Name using CSV file.

Hello Everyone,We have 250 users in Accounts OU & Sales OU. At the time of creating of users we didn't add to many details. Now we have been told to add details regarding Department, Description,...

View Article

Variable within a Variable in a foreach loop

I'm trying to run an invoke-expression command within a foreach loop that uses a variable within a variable.  Is this possible?  Any pointers would be great. Example$CmdToRun = "Get-Process X...

View Article

Change from Write-Host => export to .txt or .csv

I have a script that currently runs great with results displayed in a console. I've been trying to figure out how to change the output to a file (.txt or .csv). I have created empty files and errors...

View Article
Browsing all 8411 articles
Browse latest View live