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

Expecting script to return two results, however it is only returning one.

Goal: To take a group of user entered server names ($prompt) and search a config file on those servers for a specific value ($WSKey1) and then save those values off to be used for comparisons, making...

View Article


Brainfart, what am I doing wrong with get-help ?

Its been awhile since i’ve created help comments in PS functions and its not working like I expected. Here is what I currently have; <# .DESCRIPTION blah blah text .NAME pscred .PARAMETER username...

View Article


Auditing Fileshares from an OU

Novice here. We’re currently trying to figure out how to generate a report that targets a specific OU and returns a list of all file shares and the computer name. My logic goes something like this,...

View Article

Trouble parsing SQL data

I have, what I think, is a real head-scratcher. I am accessing a database to get a list of accounts. Each account has an account_id and account_parent_id property (among several other properties). If...

View Article

Building a Chart Using PowerShell and Chart Controls

submitted by /u/boeprox [link] [comments] The post Building a Chart Using PowerShell and Chart Controls appeared first on How to Code .NET.

View Article


Never too busy to have fun… send cat facts to coworker’s PC’s using PowerShell

submitted by /u/nickrod518 [link] [comments] The post Never too busy to have fun… send cat facts to coworker’s PC’s using PowerShell appeared first on How to Code .NET.

View Article

Pause-ForWarning script/function to wait for specified amount of time for...

I know it’s not an approved verb. I’ll change it eventually on github, I just wanted to share real quick. https://github.com/pldmgg/misc-powershell/blob/master/Pause-ForWarning.ps1 Example Usage:...

View Article

Image may be NSFW.
Clik here to view.

Understanding function that invokes itself within itself.

The below function Get-PermutationsAll takes an array of values and spits out a list of all possible combinations of these items. For example: $testarray = @(“1″,”2”) Get-PermutationsAll -array...

View Article


Ask user if they want to copy over X or Y folder; then, depending on input,...

Basically, I image computers for the exam room or the front desk. Those two areas require different software and shortcuts and are located in two separate folders on the server share. What I want is...

View Article


PowerShell Engine Enhancements

submitted by /u/rschiefer [link] [comments] The post PowerShell Engine Enhancements appeared first on How to Code .NET.

View Article

[PowerShell]Create AD Users and MAilboxes in Bulk

A script I put together that creates AD Users and Mailboxes in Bulk from a CSV file. The code can be downloaded here:...

View Article

3 ways to stop a service

I hope this is an ok place to post this. I need to figure out 3 ways to stop the following service with Powershell. Status Name DisplayName Running bthserv Bluetooth Support Service I’ve already done...

View Article

Opinions on Pester

I just started looking at Pester and I’m having a hard time with it. I love the concept of it and really want its theory to become reality in my environment. My hang up is the ‘Domain Specific...

View Article


Powershell GUI/ Out-gridview – Easily Control RDP Sessions in a collection

submitted by /u/SuddenWeatherReport [link] [comments] The post Powershell GUI/ Out-gridview – Easily Control RDP Sessions in a collection appeared first on How to Code .NET.

View Article

Managing multiple sets of imported remote machine commands

I’m supporting a Hybrid on-premises and cloud (Office 365) Exchange environment at present. I run all my PowerShell commands from my local machine with the appropriate admin credentials. I typically...

View Article


Modify script to continue after access denial

I’m working on some inventorying needs my company tasked me with and I’ve come across an interesting piece of the project. Currently, I’m able to go through an entire script using a list of server...

View Article

Use Get-EventLog to Continuously Grab Most Recent Logs from Remote Computer

Hi all, I’m looking to continuously grab the most recent logs from a client’s machine that is remote, and dump the output to a file. I’m testing an error where the machine will crash in the midst of...

View Article


Using Start-Process to pass nested arguments to an MSI that is embedded in an...

Hello! Tough one here. I inherited a very old application that I need to deploy via SCCM 2012. It deploys fine right now, but it’s a mess of 5 deployment types with 5 different detection methods, etc....

View Article

Image may be NSFW.
Clik here to view.

Is it possible to use a variable to define a conditional operator (i.e. “if(2...

I’ve googled this with several different search terms and I just keep finding posts about how to use PowerShell comparison operators, but nothing about my specific question. I want to be able to use a...

View Article

Running into a stupid UNC Issue

Here’s my snippet: Invoke-Command –ComputerName $ComputerTarget -Credential (Get-Credential) –ScriptBlock { if (-Not (Test-Path C:TEMP)) { Write-Host "" Write-Host "Temp Folder Doesn't exist, creating...

View Article
Browsing all 8793 articles
Browse latest View live