adding double quotes ofr variable
I’m trying to get a command to pick up the var in an install script. I’m doing this in serer2008r2, so v2 doesn’t seem to like it this way. Any ideas? Start-Process -FilePath...
View ArticleVariable comparison – Compare object identity (NOT value) to determine if...
All of the normal PowerShell comparison operators compare the value(s) of the variable(s). This is NOT what I’m looking for. I’m looking for a way to uniquely identify an object and see if another...
View ArticleChange Local User Idle Session Limit?
I’m getting ready to configure a bunch of servers and I’m trying to script as much of it as possible. We aren’t using Active Directory, so we can’t roll out a Group Policy to tweak everything, so I’m...
View ArticleMy script works, but is dreadfully slow. I know it can be better.
I need to pull some host information form a list of VMs, using PowerCli. This is what I have, and it works exactly as I want, but it is so slow: $servers = get-content .servers.txt ForEach ($VM in...
View ArticleMsdeploy and Powershell?
I have 100 or so websites I need to copy from one server to another. I can do single sites easily with msdeploy like so: msdeploy.exe -verb:sync -source:metakey=lm/w3svc/<WEBSITE_ID>...
View ArticleTrouble with closing Excel
I have a script that queries SQL for some data and uses that to pass in arguments to a macro stored inside an XLMS file. The code looks like this: $objExcel = New-Object -ComObject Excel.Application...
View ArticleMatch 2 columns in 2 seperate csv’s then merge one column based on match
I have 2 CSV’s. Below is just an excerpt of each so I can show how they are formatted. I would like to match the surname and givenname from SOURCE to CHANGE, and if there is a match grab the...
View ArticleStruggling with URIs
I have no idea why this isnt working… function testWebsite { param($inputUri) [System.Uri]$inputUri.GetType() } $websiteURL = 'http://www.google.com/' $uri = [System.Uri]$websiteURL testWebsite($uri)...
View ArticleMass processing csv files with horizontal align?
I have a user audit I do that’s asked of me every 3 to 6 months where I have to get a list of current employees from personnel and then run user reports out of all pieces of softwares in the...
View ArticleHow to run two “Get User” commands and get one result at the same time?
Hello /r/Powershell, Powershell newbie here. The script below currently checks to see if a user’s’ email exists in O365, then creates it if it doesn’t (AzureAD Connect). This leads to issues because...
View ArticleSetting wallpaper theme
Not sure if with powershell or somehow else, but I need a simple thing of setting the wallpaper theme for slideshow (to make it start from the first image) and really cant find out how submitted by...
View ArticlePowerShell Security at DerbyCon
submitted by /u/PowerShellChallenge [link] [comments] The post PowerShell Security at DerbyCon appeared first on How to Code .NET.
View ArticleHow to create a powershell pass through?
If am using 10 pipelines to start 10 start processes. What can I do that if an error on 7th pipeline shows it still does 8,9,10 ? submitted by /u/Eugenepath [link] [comments] The post How to create a...
View ArticlePSSession randomly end’s during script
Hello, I am running a script that uses invoke-command and I have an if statement in there, during that if statement it checks to see if a process is running for a specified user, if it is it prompts...
View ArticleScript loops through list of IP addresses – need to make it run more efficiently
The script below goes through a list of IP addresses and resolves the hostname. It then sends a quick ping to the host to see if it is online and records the status. <# Adapted from script found...
View ArticleUsing powershell to get Active Directory info for web app
I’m developing a web app that needs to display Active Directory information like the list of admins in a domain, processes running on domain computers, how many of those processes are unsigned, etc. I...
View ArticlePowershell Command to check status of all users MFA status
I’m trying to find a script that will check and create a CSV file of users with their email address, and their current MFA status (disabled/enabled/enforced). Currently on Microsoft’s Powershell...
View ArticleHow to schedule a one-time reboot via PS oneliner/function?
This is all that I have got. $action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-NoProfile -WindowStyle Hidden -command "& {Restart-Computer -Force -wait}"' $trigger =...
View ArticleUsing cookies with Invoke-RestMethod
Hey All, I’ve been experimenting with invoke-restmethod. I think I’ve mostly got the hang of it, so I decided that a fun challenge would be to grab the web reputation of a given IP from senderbase....
View ArticleChecking Dell Warranty Info with PowerShell
I used to have a script written in PowerShell that I got online that would grab a Dell PCs service tag number and check it and output warranty information. I have a program that allows me to see all...
View Article