I have a problem with Teaming made with Powershell.

Y D KIM 0 Reputation points
2023-06-13T04:43:57.58+00:00

Hi.

I made Teaming with Powershell.

But sometimes when I reboot my PC, it doesn't work.

It will be no internet access.

So I deleted the original team and created a new one to solve this problem.

Creating a new team solves the problem.

But sometimes I reboot my computer this problem appears.

And I repeat creating a new team.

So, I have Three questions.

Q1. Is it possible to fix the root cause of this issue?

Q2. If it is difficult to solve, I would like to create a script to automate deleting and recreating the team when the computer is rebooted.

In this case, you must run Powershell with administrator privileges for the command to work.

Is there a way to create a Script and automatically run it with admin privileges?

The commands I create and delete Teaming through powershell are:

  • Remove-NetSwitchTeam -Name "Team01"
  • New-NetswitchTeam -Name "Team01" -TeamMembers "Eth01","Eth02"

Q3. How do I make these commands into a script?

Windows for business Windows Server User experience PowerShell
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-06-13T10:17:41.4966667+00:00

    Hello Y D,

    Thank you for your question and for reaching out with your question today.

    I have addressed each of your questions in turn. please see below:

    Q1. To fix the root cause of the issue with your teaming configuration not working after reboot, you can try a few troubleshooting steps:

    • Ensure that you have the latest network drivers installed for your network adapters.
    • Check if there are any BIOS or firmware updates available for your computer, including updates related to network connectivity.
    • Verify that your network adapters and the teaming feature are fully supported by your operating system.
    • Review the event logs for any related errors or warnings that might provide clues about the issue.
    • Consider reaching out to the manufacturer's support for assistance, as they might have specific recommendations or solutions for teaming-related issues on your hardware configuration.

    Q2. To create a script that automates deleting and recreating the team when the computer is rebooted, you can follow these steps:

    1. Open a text editor (e.g., Notepad) and create a new file.
    2. Add the PowerShell commands to the file. In this case, the commands are:
    
    Remove-NetSwitchTeam -Name "Team01"
    
    New-NetswitchTeam -Name "Team01" -TeamMembers "Eth01","Eth02"
    
    
    1. Save the file with a ".ps1" extension, for example, "TeamingScript.ps1".

    To automatically run the script with administrator privileges, you can create a scheduled task that runs the script at system startup:

    1. Open the Task Scheduler by searching for "Task Scheduler" in the Start menu.
    2. In the Task Scheduler, click on "Create Basic Task" in the Actions pane.
    3. Follow the wizard to specify the trigger as "At startup" and the action as "Start a program".
    4. Browse and select the PowerShell executable (powershell.exe), and provide the path to the script file (TeamingScript.ps1) as the argument.
    5. Complete the wizard and save the scheduled task.

    The scheduled task will run the PowerShell script with elevated privileges at system startup, ensuring that it can execute the teaming commands successfully.

    Q3. The commands you provided can be easily converted into a PowerShell script. Here's an example:

    
    # Remove the existing team
    
    Remove-NetSwitchTeam -Name "Team01"
    
    # Create a new team
    
    New-NetswitchTeam -Name "Team01" -TeamMembers "Eth01","Eth02"
    
    

    Copy these commands into a text file, save it with a ".ps1" extension (e.g., "TeamingScript.ps1"), and you'll have a PowerShell script that deletes the existing team and creates a new one.

    Remember to run the script with administrative privileges by following the instructions in Q2 to ensure it has the necessary permissions to execute the teaming commands.

    Note: Before executing any script, it is always a good practice to thoroughly test it in a non-production environment and ensure it meets your specific requirements and configurations.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    Best regards.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.