But if we run this code on Web Page we have a issue.
I am not familiar with SCVMM, but since you are getting an access error, I might be able to help with IIS.
When you execute the code on the console, the Powershell.exe process runs as the account you are logged on to the desktop with. When you try to connect to network resources, (\Server\Share) the local server authenticates your account with the remote server.
In IIS "the account" could be the client user account, but it could also be the IUSR account, or the worker process identify for the site. It all depends on your code and how you configured the site.
Is the site set up for anonymous access or do you authenticate the user? If you authenticate, do you also have impersonation set for the user?
Will every user that accesses the web site have access to the SCVMM server? (I apologize for my lack of knowledge of that environment.) Is the "SCVMM server" running on the same machine as the web site?
If the web site is on the same machine as the SCVMM service that you connect to, then you should be able to configure the site to impersonate the user. That way SCVMM will "see" who the user is.
https://learn.microsoft.com/en-us/previous-versions/aspnet/134ec8tc(v=vs.100)
If the web site on a different server, then you have 3 machines involved in the process. The client running Edge/Chrome, the web server running IIS, and the SCVMM server. In that case you might run into the infamous kerberos double hop problem.
One workaround to that is to authenticate, but not impersonate the end user. Then set the IIS worker process for the site to use an account that has access to SCVMM. The problem with doing that is that every user who accesses the site has the same access to SCVMM. You have to programmatically control "who can do what" with the web site code.
I think that's enough for now. Hope this helps.