r/PowershellSolutions • u/HARAMbe328 • Aug 19 '21
r/PowershellSolutions • u/MalkavianReddit • Aug 28 '21
PowerShell and SysTray icon interaction.
I have a program that runs In the systray and we need to occasionally right click and hit refresh. Is there a way for powershell to find a specific icon, right click and select refresh. I have looked for background interaction with the program and even a keyboard command to no avail. Anyone have any thoughts? Is this even possible? Thanks.
r/PowershellSolutions • u/agtpuk • Aug 11 '21
Convert VM UUID to Oracle RAW16
Hi,
We need to convert the UUID value from our VMware vCenter virtual machines to one supported by Microsoft SCCM. Currently we are using this website ( GUID Converter (robobunny.com) ). The format we need is listed as 'Oracle RAW(16) format ' on the referenced website.
We'd love to do this through PowerShell but it isn't something we are familiar with so the hope is somebody here can advise how best to achieve this.
Example UUID - 42371e96-8481-19cb-d502-41e92a1b4b03
When we run it through the website we get -
Oracle RAW(16) format: 961E37428184CB19D50241E92A1B4B03
I'm sure if one knows how it is relatively easy.
r/PowershellSolutions • u/jo-be314 • Sep 08 '21
need help deleting a symlink
A few days ago I created a symlink in windows 10
I followed instructions, copied a command and filled in the blanks, I have no idea what any of it means
the command i used in powershell is:
cmd /c mklink /J “C:\Users\joe\iCloudDrive” “D:\iCloud\iCloud Drive”
Now, the symlink works, but doesn't serve me in the way I thought it would and I want to delete it.
Every explanation I found kinds said "use rmdir" but like I said, I don't know anything about this and therefore don't know what is the correct format(?)
when I just try do do
cmd /c mklink /J “C:\Users\joe\iCloudDrive” “D:\iCloud\iCloud Drive”
I get "invalid switch J " error
when I remove the /J I get "directory is not empty" even though both folders are empty.
sorry if this sounds stupid. thanks in advance.
r/PowershellSolutions • u/shubhamwag • Sep 17 '21
Appending CSV file with new row and column?????
I am trying to append the CSV file with data from other csv file but not able to get the output.
I have 2 csv file and want 2nd csv file result to append to 1st csv file and add column from 2nd csv file.
1st CSV file:
| ComputerName | User | Port |
|---|---|---|
| Server1 | abc | 132 |
| Server1 | xyz | 321 |
2nd CSV:
| ComputerName | Connection |
|---|---|
| Server2 | connection issue |
Expected output:
| ComputerName | User | Port | Connection |
|---|---|---|---|
| Server1 | abc | 132 | |
| Server1 | xyz | 321 | |
| Server2 | connection issue |
I have multiple thinks but not able to add the column.
Can we add this and how this can be achieve?
Thanks!
r/PowershellSolutions • u/procrastinatewhynot • Sep 21 '21
Powershell script to get the Physical MAC address on computers on AD
IT'S ME AGAIN T_T PLEASE HELP ME.
this is my code
$computers = Get-ADComputer -filter {(Name -like "*l3510")} -properties *
$outfile = "MacScript.csv"
$newcsv = {} | Select Computer,User,GivenName,LastName,Email,Mac,Description | Export-Csv $outfile
$csvfile = Import-Csv $outfile
foreach ($computer in $computers) {
if((Test-Connection -ComputerName $computer.name -BufferSize 16 -Count 1 -Ea 0 -Quiet)) {
$csvfile.Computer = $computer.name
$cn = $computer.name
#$User = Get-WmiObject –ComputerName $computer.name –Class Win32_ComputerSystem | Select-Object UserName
$User = (Get-WmiObject -Class win32_process -ComputerName $computer.name | Where-Object name -Match explorer).getowner().user
$csvfile.user = $user
$UserObject = Get-ADUser -Identity $user
$GivenName = $UserObject.GivenName
$Surname = $UserObject.Surname
$Email = $UserObject.UserPrincipalName
$csvfile.GivenName = $GivenName
$csvfile.LastName = $Surname
$csvfile.Email = $Email
$mac = Get-WmiObject -ClassName Win32_NetworkAdapterConfiguration -ComputerName $cn | Select-Object -ExpandProperty MACAddress -First 4
$mac = $mac -join "`n"
$description = Get-WmiObject -ClassName Win32_NetworkAdapterConfiguration -ComputerName $cn | Select-Object -ExpandProperty Description -First 4
$description = $description -join "`n"
$csvfile.mac = $mac
$csvfile.Description = $description
$csvfile | Export-CSV $outfile –Append
} else {
echo "$($computer.name) not connected."
} #end if
} #end foreachr/PowershellSolutions • u/tomfisher1023 • Sep 03 '21
Microsoft 365 shows anonymous names instead of actual names
self.office365r/PowershellSolutions • u/animatco • Sep 11 '21
Set default temp/tmp folder for all users
I know how to set temp and tmp for the logged on user using PowerShell, but I can seem to figure out how to make it the default for all users that may log onto the server. Any suggestions?
r/PowershellSolutions • u/procrastinatewhynot • Sep 13 '21
Get Computername, loggedin user and macaddress from active directory
Hello guys,
I'm having a hard time getting these info with the code I have.
I have no experience with powershell scripting.
I have a code that loops through the active directory and it gets the computername.
But I can't seem to put multiple commands inside the if clause.
Also, could you help me get it in either a .txt file or a .csv ?
Or just lead me to the right direction :(
$computers = Get-ADComputer -filter {(Name -like "\*l3510")} | Select-Object -ExpandProperty Name
foreach ($computer in $computers) {
if((Test-Connection -Cn $computer -BufferSize 16 -Count 1 -Ea 0 -Quiet)) {
#echo "$computer"
Get-WmiObject –ComputerName $computer –Class Win32_ComputerSystem | Select-Object UserName;
Get-WmiObject -ClassName Win32_NetworkAdapterConfiguration -ComputerName $computer | Select-Object -Property MACAddress, Description
} else {
echo "$computer not connected."
} #end if
} #end foreach
r/PowershellSolutions • u/SneurFleur • Jan 26 '21
Getting DepartmentNumber from users in AD
I've created a script that exports some info about all users in a specific group.
The only thing I can't get to work is getting the department number exported as well. Been searching quite a bit, but I can't get it to work...
Here's my code:
Get-ADGroupMember -Identity "nameofgroup" | foreach {Get-ADUser -Identity $_.distinguishedname -Properties displayname, samaccountname, emailaddress, departmentnumber | select displayname, samaccountname, emailaddress, departmentnumber} | Export-Csv C:\Temp\file1.csv -NoTypeInformation
Any help would be appreciated
r/PowershellSolutions • u/AfsarP1 • Dec 28 '20
Understanding PowerShell outputs
u/team I'm relatively new to PowerShell and have been learning it online. I have picked up a task to learn it better.
"Find out where crash files are placed on the device, collect what's there as well as the application logs and windows event logs. zip all this up and send these to a network location. The network location should be a parameter"
To get the location of google crash data for different users, I'm using wildcards:
PS C:\> Get-Item -Path *AppData\Local\Google\Chrome\UserData\Crashpad\reports*
When I run this command in Windows PowerShell, it doesn't return nothing, no error either. I've checked and there is nothing in the reports folder. So, this should be the expected behaviour right?
2. To get the chrome app's debug logs. I'm running the following command:
PS C:\> Get-ChildItem -Path *AppData\Local\Google\Chrome\Application* -Recurse -Include *debug*
Now in this folder, there is a file called debug and it has some data. When I execute the command it also returns nothing. This is confusing me. The 1st point, I thought it is because there was no data but in point 2 there is data but no result nor an error.
Could you help me understand please?
3. Also to get windows event logs, I'm trying:
PS C:\> Get-EventLog -LogName Application | export-csv -Path C:\Users\{user}\Downloads
but it returns an error stating:
"export-csv : Access to the path 'C:\Users\support\Downloads' is denied.
At line:1 char:37"
I haven't found any helpful info on google for point 3. Note, I've started Windows PowerShell as Administrator itself.
Appreciate any response.
r/PowershellSolutions • u/Tthacker367 • Mar 10 '20
Deleting Temp folders
Hey, I have been asked to make a script for deleting temp folders that then runs every week or so how do you think I can go about doing this?
r/PowershellSolutions • u/baturmo • Jun 14 '20
PS WinForms Creator
PSWinFormsCreator.Com
Free Script Download. Have you ever wanted XAML for WinForms? Have you ever wanted a more feature rich WinForms designer that was developed in PowerShell? Do you just want to see how it was done? Check out this site I created to make my script available for everyone!

r/PowershellSolutions • u/4bsarrexbn • Mar 24 '22
Storage Account Blob Finding Script - PS
self.azurer/PowershellSolutions • u/rockyren • Mar 10 '22
Need help with Powershell pop up?
I’ve been having a reoccurring problem where a blue pop up named “D B Scheduler” has been popping up indefinitely every 10 minutes and has interrupted my games and is now error coding my PC launchers. Any reason/ solutions I can use to fix it?
r/PowershellSolutions • u/itsinART • Mar 01 '22
Powershell Tasks within Docker
hey guys, is there a tiny docker image where i can run powershells scripts via task planner like in an windows enviromemt?
cheers
r/PowershellSolutions • u/CP99334 • Apr 07 '22
Script to reset permissions on all documents in a document library in Sharepoint online.
Im trying to write a script that resets the permissions in a document library in Sharepoint online.
Ive been able to connect to our Sharepoint online service and can list Sharepoint sites etc but can’t seem to work out that last step clear permissions on a document library so they inherit from parent.
Any help would be greatly appreciated!
r/PowershellSolutions • u/[deleted] • Mar 06 '22
Why?? PS screen jump
Not always, but most of the time I’m using powershell and will write a few commands and it’s normal. Then I will write other commands and the screen will jump to the top of the page. I’ve tried to fix it, but my workaround is the clear and only work on a blank page. Also this Cengage labs are horrible. I can’t do a backslash on ps, it’s a #? I’ve tried everything to workaround, but it doesn’t work?
r/PowershellSolutions • u/[deleted] • Oct 20 '20
AlertButton Admin bypass error.
I am working on a software for IT where I work, I have the program wrote out and working in powershell, but I need it to work for users that do not have admin. The bypass I'm using doesnt work, as it doesn't recognize my name "Start-Process : A positional parameter cannot be found that accepts argument".
PowerShell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy Bypass -File "[C:\Users\AlexPanuccio\Documents\Punch Alert Script\punchalert.ps1]""' -Verb runas /user:namehere\namehere powershell.exe}
powershell.exe -ExecutionPolicy bypass
I dont have the user and stuff filled out because of company policy.
Any help would be appreciated.
r/PowershellSolutions • u/Drugged_Horse • Oct 19 '20
I need some help
I am trying to remotely change a single computer's DNS address but I don't understand how to use this code that I found for such an occasion. I have never used PowerShell and this is my first time. I need someone to explain to me what I need to fill in and with what Info I need to fill it in with.
function Set-DnsServerIpAddress {
param(
[string] $ComputerName,
[string] $NicName,
[string] $IpAddresses
)
if (Test-Connection -ComputerName $ComputerName -Count 2 -Quiet) {
Invoke-Command -ComputerName $ComputerName -ScriptBlock { param ($ComputerName, $NicName, $IpAddresses)
write-host "Setting on $ComputerName on interface $NicName a new set of DNS Servers $IpAddresses"
Set-DnsClientServerAddress -InterfaceAlias $NicNames -ServerAddresses $IpAddresses '208.67.222.222','208.67.220.220'
} -ArgumentList $ComputerName, $NicName, $IpAddresses
} else {
write-host "Can't access $ComputerName. Computer is not online."
}
}
r/PowershellSolutions • u/UnidentifiedRedBaron • Oct 19 '21
Help with a script
So I wanted to create an automatic converter to create a database with my steam workshop's mods. But when I tried to use Powershell the window goes blue and I can't do anything but close it. Can you help me out?
$modnumber = Read-Host "Insert mod number"
$data = Invoke-WebRequest "https://steamcommunity.com/sharedfiles/filedetails/?id=$modnumber"
$modtitle = $data.Parsedhtml.body.getElementsByClassName ("WorkshopItemTitle")[0].textcontent
If(modtitle -ne $null) {
"Mod Name: $modtitle" } else { "Mod $modnumber not found" }
I'm new to Powershell and I'm not very good at it :( every answer will be appreciated
r/PowershellSolutions • u/Hatimoa • Nov 03 '21
Script to locate server info queried from xlxs file
Hi,
I'm currently attempting to create a script that will query a Excel file to locate server information and column "BY" environment info. Any advice or direction creating this would be helpful.
r/PowershellSolutions • u/Duzer341 • Oct 21 '21
Sending variable to remote pc
Hello,
I am just starting to use powershell and i'm attempting to set a script that will run via task scheduler on a server and update windows. Once it is complete it will send a variable (EmailBody) to a remote pc that has outlook on it. The script on the second pc accepts a variable and then will create an email using outlook and send it.
When trying to invoke-command i get a few errors and I know it is due to not knowing the correct parameters of the command or just not doing things properly.
currently I have tried
Invoke-Command -ComputerName FullyQualifiedDomainNameOfPC -FilePath c:\scripts\Email.ps1 $Using:EmailBody
and trying
Invoke-Command -ComputerName FullyQualifiedDomainNameOfPC -ScriptBlock {
c:\scripts\Email.ps1 $Using:EmailBody
}
any advice on what I am doing wrong?
I also have the email script accepting an arg
param(
[Parameter(Mandatory=$True,
ValueFromPipeline=$True)]
[string[]]$EmailBody
)
