Quantcast
Channel: /r/powershell – How to Code .NET
Browsing all 8793 articles
Browse latest View live

Prank-Coworker : A function filled with goodies designed to wreak havoc on...

submitted by /u/jfractal [link] [comments] The post Prank-Coworker : A function filled with goodies designed to wreak havoc on your unsuspecting coworkers. Enjoy! appeared first on How to Code .NET.

View Article


Permissions Map

I inquired about multiple switch parameters and how to deal with them about 2 days ago, to which I received amazing feedback. I wanted to provide everyone with what came of that. I built a function,...

View Article


Get Time from Remote Machines

im trying to get a reliable script to confirm time is in sync across multiple computers. I have one working using net time but want to use psremoting and get-date but up to other reliable suggestions....

View Article

FTP in powershell

Can someone please help me with a FTP script to upload .csv files to our FTP server via PowerShell. If file exist on the server to delete and replace with the new ones. Thanks in advance. submitted by...

View Article

Invoke-Command on remote computer to run a remote program

Hey all, I’m trying to run a script that’s stored on a server on a remote computer It keeps throwing up an access denied error: Invoke-Command $comp {Start-Process \SERVERcalc.exe} This command cannot...

View Article


Updating Static DNS on multiple servers

I am being tasked with updating the DNS servers on all the NICs in one of our static domains and I’m trying to figure out the best way to tackle this. PS Remoting is out because there are dozens of...

View Article

Need Some Assistance Debugging a Script

I’ve googled the error message I get and nothing I find is of any help whatsoever. Bear in mind, I am relatively new to PowerShell. I’ve only written a few scripts. The gist of the script is that it...

View Article

Can you name a new variable from another variable?

For example: $a = “web” $b = “site” $($a+$b) = “Reddit” Instead of: $website = “Reddit” submitted by /u/312pm [link] [comments] The post Can you name a new variable from another variable? appeared...

View Article


Checking if Group Exists before creating.

Hi All, I have created a script to check if the group exists before creating. However the script is still making the group so the checks are not working. I was wondering if anyone may offer...

View Article


Variable isn’t showing up in the expression.

Hi Guys, I’ve been trying to write a piece of a script that will be part of the New Employee process. $Managerlast = Read-Host "Enter Manager Last Name" $Manager = (Get-ADuser -Filter {SamAccountName...

View Article

How to modify elements of a GUI-based Powershell Script?

I’ve been looking for a POSH script to create Active Directory and Office 365 user accounts and stumbled upon Active Directory User Creation tool 1.2 on the Technet Script Center. It is a Windows...

View Article

Adding the results of Null before continuing

Hi All, I don’t know what the best way to describe this is but ill try my best. I have a script that will create 3 groups and I need to do some checks before I create those groups. If one of the 3...

View Article

Powershell is creating two different Excel files of my same data?

So I am writing code that processes data and writes it to an Excel file. Everything works good, but when I click on the SINGLE file in the folder that Powershell created, I get TWO Excel files to open...

View Article


Image may be NSFW.
Clik here to view.

Split/Comparing not working

hello, i’m having the following code: foreach ($line in [System.IO.File]::ReadLines('C:templist.txt')) { $current = $line -split ' - ' if($previous -ne $current[0]){ Write-Output $current[0] }...

View Article

Watson Error when removing activesync relationships in Office 365 via...

We have a script that runs and removes all activesync mobile device relationships over 30 days old in our Office 365 environment. Here is the part of the script that runs to remove the devices and has...

View Article


Remove-ADPrincipalGroupMembership and multiple Where filters

I’m trying to run Remove-ADPrincipalGroupMembership to automate handling of stale users. I’m trying to run Remove-ADPrincipalGroupMembership to remove all their group membership, but if left alone (no...

View Article

Functions seem to be weird, can anyone explain it simply so i understand?

Ok im just starting to use functions or trying to… I started out on AutoIt doing simple stuff Windows automation stuff etc and i always used to have problems with functions. Its been a while but...

View Article


WPF listView, how do I select a column?

I’m using Visual Studio to create a WPF GUI for a powershell script. How can I select a particular column to add data to? I’ve looked around online and I can’t seem to find a good solution for this....

View Article

Compare CSV to AD – Export Unknown Accounts to Another CSV

Hey All, I have an issue with a PS script that I am trying to get functional. I have a User.csv file that I am importing and I want to compare it against all known users in Active Directory and tell...

View Article

Writing binary data to a multi-string reg key property

I’m trying to mark files for deletion on boot via script. After some internet searching, I found a couple ways to approach this, but am having no luck with either, and the underlying problem seems to...

View Article
Browsing all 8793 articles
Browse latest View live