Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (2024)

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (1)

You may come across the error message around Select-MgProfile not being recognized anymore in your Azure automation code or scheduled scripts that connects to Entra ID (Azure AD) using Microsoft Graph.

The full error message is given below.

Select-MgProfile : The term ‘Select-MgProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Select-MgProfile -Name “beta” + ~~~~ + CategoryInfo : ObjectNotFound: (Select-MgProfile:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (2)

Table of Contents

Microsoft Graph SDK v2

Before Graph SDK v2 was released, admins used the “Select-MgProfile beta” command to execute beta commands and “Select-MgProfile v1.0” for the v1.0 commands. And this worked really well.

With the introduction of Graph SDK v2, Microsoft has stopped accessing the beta endpoint within the v2 module. If you want to access beta endpoint and already have Graph SDK v2 installed, you need to install the Graph Beta module separately.

The new beta module commands have the word ‘beta’ in the commands, for example, Get-MgBetaUser. The same command within v2 will be Get-MgUser.

How To Fix “Select-MgProfile is not recognized” error?

If you are running a code that has v1.0 commands and you upgraded your Graph SDK on the Hybrid worker server or the server from which you run the scheduled scripts, it may be necessary to comment out the “Select-MgProfile beta” line (depends on the code).

If you want to access the beta endpoint commands and have upgraded your SDK to v2, you need to install the Graph Beta module as well. This way, you can use both modules (v2 & Beta) side by side without needing to switch profiles.

Install Graph PowerShell Beta Module

Run the command below in PowerShell to install the Graph Beta module.

Install-Module -Name Microsoft.Graph.Beta

If you want to install a particular version of the Beta module (for whatever reason), you need to use the ‘RequiredVersion’ parameter. For example, run the command below to install v2.8.0.

Install-Module -Name Microsoft.Graph.Beta -RequiredVersion 2.8.0

Update Graph PowerShell Beta Module

Run the command below to update the Beta SDK to the latest version. Updating the Graph SDK v2.0 does not update the beta module.

Update-Module Microsoft.Graph.Beta

Remove Graph PowerShell Beta Module

Run the command below to remove the Beta SDK completely.

Uninstall-Module Microsoft.Graph.Beta -AllVersions

Please let me know if you have any questions in the comments section.

Other Popular Articles

Windows Copilot is Microsoft’s take on making life easier for Windows users using the power of AI. This article explains how to disable the feature using Intune, if your organization is not ready yet to walk into the AI world.

Table of Contents

Disable Windows Copilot Using Intune

We need to create a Configuration Profile for Windows devices in the Intune portal to disable Windows Copilot. Below are the steps that we need to create the profile.

Launch the Intune Portal and login as a Global Admin or Intune Admin.

Navigate to Devices -> Windows -> Configuration Profiles.

Click on Create -> New Policy.

Select Windows 10 & later as the platform and Settings Catalog as the profile type & click on the Create button.

Give the policy a meaningful name & description and click Next.

Within the configuration settings, click on the Add Settings option.

Search for ‘copilot’, Windows AI will come up as the category. Click on Windows AI and the Turn off Copilot in Windows (User) setting will come up. Check the box and click Next.

Specify scope tags if required and click Next.

Select who this policy should apply to in the Assignments section. I have selected to add all users. If you want to test the setting, you can create a test group and select that group here.

Similarly, you can also exclude certain group from disabling AI (say IT team) if required.

A summary of selected settings will be displayed. Click on the Create button to setup the policy to disable Windows Copilot.

Wait for the replication to complete in the cloud backend and login to your machine. Your chatty Copilot should now be disabled.

Disable Windows Copilot On Windows 11 Pro

Follow the steps below to disable Copilot on a personal Windows 11 Pro machine (say your own laptop).

Search for ‘group’ in Windows 11 and click on Edit Group Policy option.

Navigate to User Configuration -> Administrative Templates -> Windows Components -> Windows Copilot.

Double click on Turn off Windows Copilot setting on the right pane.

Select Enabled and click OK.

Close the Group Policy Editor. This will disable Windows Copilot on a Windows 11 Pro machine.

Summary

We have learned to disable Windows Copilot using Intune and Group Policy on Windows 11 machines.

Please let me know if you have any questions in the comments section.

Domain controllers are the backbone of any Active Directory domains in the Microsoft world. Any Windows server can be promoted to be a domain controller. In this article, we will go through the steps of promoting a Windows 2025 Server to be a domain controller.

Table of Contents

Windows Server 2025

The latest version of the server operating system has been named Windows Server 2025. You can start with a 2025 Server & create an AD domain or you can promote a member server that is already a part of a domain.

The Windows Server 2025 needs to be installed on a machine before it can be promoted to be a domain controller.

Promote Windows Server 2025 To Domain Controller

If you have been working with Windows servers long enough, everything starts with the Server Manager app. Promoting a server to a domain controller is no different.

Launch ‘Server Manager’ & click on Add roles and features.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (18)

You land on the summary page that explains what is required to run this wizard successfully. Click Next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (19)

Select Role-based or Feature-based installation and click Next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (20)

Select the server that needs to be promoted and click Next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (21)

Select Active Directory Domain Services (second option) and click on Add Features.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (22)

Go with the default options for features that need to be installed.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (23)

A summary of AD DS pops up next, click next to continue.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (24)

Select Restart the server automatically if required and click Install.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (25)

You get to keep an eye on the progress of the installation.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (26)

Once the role has been installed, you will find an exclamation mark on the top right corner of the Server Manager. Click on that and select Promote this server to be a domain controller.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (27)

You get an error straight away (which you have never seen before) – Error determining whether the target server is already a domain controller. Role change is in progress or this computer needs a restart.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (28)

We never needed to restart the server after installing the role in the DC promotion process. Given that it is an insider build of Server 2025, I am hoping that this will get fixed before the public release.

Restart the server, launch Server Manager and click on the Promote this server to be a domain controller option again.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (29)

I am setting up a brand new AD forest and hence I select the third option (Add a new forest) and enter my root domain name.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (30)

Next window brings the option to set your forest & domain functional level and the DSRM password. In the insider build, it shows what looks like a variable (the Windows server version on which the you are working).

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (31)

You can leave the default options in the DNS options wizard and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (32)

Enter the netbios name of the domain in the next window and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (33)

You can stick with the default paths for the AD database, log & sysvol folder or pick a location of your choice.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (34)

Review the selections that you have made so far and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (35)

Wait for the green check mark on the prerequisites page and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (36)

Click Install in the final window & wait for the magic to happen. Once the machine gets restarted (which it will do automatically), you will have a brand new domain controller based on Windows Server 2025.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (37)

Summary

Promoting a Server 2025 to a domain controller follows pretty much the same steps as previous operating systems. The Insider build has few errors that needs to be fixed, but hey, it is an insider build!

Please let me know if you have any questions in the comments section.

Microsoft has released an insider preview of it’s next server operating system named Windows Server 2025. We will have a look at the installation steps involved in setting up a 2025 server.

Table of Contents

Windows Server 2025

Microsoft has gone with the same look and feel of Windows 11 operating system in it’s current server operating system – Windows Server 2025. As the product is in insider preview, there might be slight changes before it hits the public shelves.

It is refreshing to see a ‘modern’ feel in the installation process of a server operating system. Gone are the days where the installation of a consumer based OS felt much better compared to it’s server counterpart.

Installing Windows Server 2025

Let’s take a look at the steps involved in setting up a Windows Server 2025 machine. First step is to download the ISO from the Windows Insider portal.

Next step is to boot the virtual / physical machine from the ISO which will kick off the installation of Server 2025.

First option to select is the language settings. Pick the one based which relates to you and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (38)

Select the keyboard settings in the next screen and click next.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (39)

You get the option to select whether you want to Install Windows Server or Repair the installation. The bottom left corner also has the option to go to the previous version of setup.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (40)

You are asked to enter the product key, which is available in the Windows Insider portal.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (41)

Next option to choose is the type of image you want to install – Windows 2025 core or full blown desktop experience.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (42)

You need to agree to the licensing terms to move forward in the next step.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (43)

Select the partition on which the server OS should be installed and click next. You also have the option to slice the partitions the way you see fit in the same screen.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (44)

The Ready to Install window comes up, click the install button.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (45)

Installation of Server 2025 is underway and you get to see the progress.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (46)

Once the installation is complete, you need to enter an administrator password of your choice to finalize the setup.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (47)

And there you go! You see a Windows 11 login screen staring at you ;-)

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (48)

After logging in, you get to set the options around sending diagnostic data to Microsoft, which I always set as ‘required only’.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (49)

The Windows Server 2025 desktop looks similar, doesn’t it? ;-)

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (50)

Now that the server is up and running, you can promote it to be a domain controller.

Summary

The Windows Server 2025 has the same look and feel as a Windows 11 operating system. The installation options also provide that modern ‘feel’ and makes it a bit soothing to the eyes!

Please let me know if you have any questions in the comments section.

Error - Select-MgProfile Is Not Recognized As The Name Of A Cmdlet, Function Or Script File (2024)

References

Top Articles
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5905

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.