Lee Roy Anthony commented on
Change remote IP address and DNS entry with a PowerShell script 3 weeks, 3 days ago
Hi Emanuel!
Invoke-Command is now my new best friend!
In fact, I’ll also be using it for a code to extract the value of InterfaceIndex (thru Get-Netadapter). But how do I get the value/s of the property/ies (like InterfaceIndex and InterfaceAlias) of Get-Netadapter and use it/them, say move the value/s to a variable/s?
Thank you!
Lee Roy Anthony commented on
Get-NetAdapter – Managing NICs with PowerShell 3 weeks, 3 days ago
Is there a way to get the value of InterfaceIndex and move it to a variable?
Michael Pietroforte edited the doc Install Hyper-V with PowerShell in the group
PowerShell 4 weeks, 1 day ago
In this second post in my series about Hyper-V management with PowerShell I will explain how to create a Hyper-V virtual switch with PowerShell. In my previous post I explained how to install Hyper-V with PowerShell.
Surender Kumar created the doc
Install Hyper-V with PowerShell
1 month ago
In this first post of my series about managing Hyper-V with PowerShell I will outline how to install Hyper-V Server and the Hyper-V role with PowerShell.
I got this error when run that script. Please help
I got this error when run that script. Please help
Export-Csv : Cannot bind parameter ‘Delimiter’. Cannot convert value “NoTypeInformation” to type “System.Char”. Error: “String must be exactly one
character longPlease help. I got below error when run script
Export-Csv : Cannot bind parameter ‘Delimiter’. Cannot convert value “Encoding” to type “System.Char”. Error: “String must be exactly one character
long.”
At D:MyselfPSToolsCollectingSystemStability&ProblemOri.ps1:5 char:102
+ … ERPROFILEDocumentsReliabilityStabilityMetrics.csv ‑Encoding ASCII – …
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Export-Csv], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ExportCsvCommandExport-Csv : Cannot bind parameter ‘Delimiter’. Cannot convert value “Encoding” to type “System.Char”. Error: “String must be exactly one character
long.”
At D:MyselfPSToolsCollectingSystemStability&ProblemOri.ps1:6 char:84
+ … V $env:USERPROFILEDocumentsReliabilityRecords.csv ‑Encoding ASCII – …
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Export-Csv], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ExportCsvCommandThe -h switch of PsExec takes care of elevation problems. By the way, if nothing else works, you could use regular PowerShell remoting command like this:
Invoke-Command -ComputerName remoteServer -FilePath D:ScriptsyourScript.ps1 -Credential domainadmin
But how can one use Psexec to execute a PowerShell script on a Windows server, and inject domain username/password (eg. Create-FailoverCluster that requires permissions to create AD computer object)?
The user invoking the PowerShell script is NT AUTHORITYSYSTEM (from an Azure DevOps automated pipeline), but need the PS1 file to run with domain credentials. I can get the username and password to the script, but seems that it is not allowed to elevate the creds.
Any advice?
Emanuel Halapciuc commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
You’re welcome, Lee
Lee Roy Anthony commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
Hi Emanuel!
This is great! I’ll go ahead and try.
Thank you so much!
Emanuel Halapciuc commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
In this case, PowerShell Direct is your friend. The VM needs to be on, but otherwise you can run the commands from the host. If the VMs are not in the same domain as the hosts, you can specify different credentials.
Lee Roy Anthony commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
Hi Emanuel!
Thank you for replying! Well, my situation is that I need to run your commands ‘outside’ the VM. Sorry for the newbie term (‘coz I’m exactly that – a newbie). Specifically, the Set-DNSClientServerAddress command. This command necessitates me to be ‘inside’ the VM so I can change it’s DNS IP address. I need to do this while I’m ‘outside’ the VM. In fact, I’m adding this line of code to a Powershell syntax that automates VM creation installed with a virtual hard drive (to also automate OS installation) plus setting up virtual network connection with a specific DNS server. The part with the DNS server that I have to specify for the VM is the tricky part for me.
Emanuel Halapciuc commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
Hi, Lee, Roy, and Anthony. 🙂
I’m glad you find this useful. You can run this command just as well inside VMs, there’s no actual difference. Or is it something specific to VMs that you had in mind?
Lee Roy Anthony commented on
Change remote IP address and DNS entry with a PowerShell script 1 month ago
Hi Emmanuel!
Your codes are a godsend!
Would it be possible for you to provide equivalent codes if we’re to apply these to virtual machines/VMs? Thank you!
Mike Kanakos wrote a new post,
Export and import to and from Excel with the PowerShell module ImportExcel 1 month, 1 week ago
The ImportExcel is a PowerShell module that allows you import to or export data directly from Excel spreadsheets without having Microsoft Excel installed on your computer. In this tutorial, you’ll learn to work with Import-Excel and Export-Excel. The ImportExcel module runs on Windows, Linux, or Mac and now can be used in Azure functions and GitHub Actions. Simply put, if you need to generate reports for work, you must learn this module.
Dimitri Crève commented on
Using the Convert-EventLogRecord function alongside the Get-WinEvent PowerShell cmdlet to search Windows event logs 1 month, 1 week ago
Legend!
I’ve set up Windows Event Forwarding (50 servers that send logs to 1 collector) and this just made my work a lot easier.
Thanks and keep up the good work
Prepcsolution commented on
Installing OpenSSH on Windows 10 (1803 and higher) and Server 2019 1 month, 1 week ago
Error 0x800f0954 usually occurs at the time of installing the .NET Framework or sub-components on Windows 10. Here’s how to resolve this issue in simple steps.
In recent days, most Windows 10 users are reporting error 0x800f0954 while installing .NET Framework 3.5 or its subcomponents. Whatever may be the reason behind the error, the good thing is that you can fix the error by following some simple steps. Here are the best possible solutions to deal with this situation.
Thank you. I was thinking of how to rollback (remove) the extension, if something should go wrong or if management wants to remove it down the line. When we submit a “Change” we also need a rollback plan.
This script works great for installing. Thank you very much for that.
- Load More