networkcredentials

Accessing network share via Process.Start(path) using network credential

隐身守侯 提交于 2021-01-28 03:53:30
问题 I am using this Impersonator class to impersonate a domain account to access a network share like so: using(new Impersonartor(username, domain, password)) { //Code Here } Copying the file from the network share works okay: using(new Impersonartor(username, domain, password)) { CopyAll(uncPath, localPath) } However, using Process.Start to view the UNC share in Explorer throws a "Logon failure: unknown user name or bad password": using(new Impersonartor(username, domain, password)) { Process

Prompt for credentials in ASP.NET / C# page, pass to PowerShell

蹲街弑〆低调 提交于 2020-07-19 19:03:55
问题 I'm looking to build a proof of concept / demo webpage that will: Run as a service (no authentication required initially) Prompt for credentials (i.e. to allow providing alternate credentials, ideally capture this as System.Management.Automation.PSCredential). No authentication is required here, I just need to capture the credentials. Pass credentials in to PowerShell (e.g. shell.Commands.AddArgument(pscred) ) Use these credentials in PowerShell (pass in as, or convert to System.Management

Prompt for credentials in ASP.NET / C# page, pass to PowerShell

↘锁芯ラ 提交于 2020-07-19 19:03:09
问题 I'm looking to build a proof of concept / demo webpage that will: Run as a service (no authentication required initially) Prompt for credentials (i.e. to allow providing alternate credentials, ideally capture this as System.Management.Automation.PSCredential). No authentication is required here, I just need to capture the credentials. Pass credentials in to PowerShell (e.g. shell.Commands.AddArgument(pscred) ) Use these credentials in PowerShell (pass in as, or convert to System.Management

Are there any implicit assumptions in Import-Clixml when importing credentials?

…衆ロ難τιáo~ 提交于 2020-02-22 08:01:47
问题 I wonder if there are any implicit assumptions that I've taken that may make the code malfunction? There is a reason I want to avoid using Import-Clixml cmdlet? Hence, I've developed an alternative, i.e. a sequence of command that is aimed to extract username and password from CliXml file created with Export-Clixml. It works by now but I'm not sure if for instance the splitting solution is reliable. $credFileUriBld = [UriBuilder]::New('file','localhost',-1,"MyCredentials.xml")) $credFile =

Are there any implicit assumptions in Import-Clixml when importing credentials?

自作多情 提交于 2020-02-22 08:01:28
问题 I wonder if there are any implicit assumptions that I've taken that may make the code malfunction? There is a reason I want to avoid using Import-Clixml cmdlet? Hence, I've developed an alternative, i.e. a sequence of command that is aimed to extract username and password from CliXml file created with Export-Clixml. It works by now but I'm not sure if for instance the splitting solution is reliable. $credFileUriBld = [UriBuilder]::New('file','localhost',-1,"MyCredentials.xml")) $credFile =

Authenticate network credential to access SharePoint site on client object model

痞子三分冷 提交于 2020-02-02 06:22:46
问题 I am working to small app, that is require to bring all users in all groups of given site. I have two sites; SharePoint 2010 running on premisses and SharePoint 2013 online. I am getting credential error... {"The remote server returned an error: (401) Unauthorized."} code. public class Program { static void Main(string[] args) { string _siteURL = "https://intranet.co.uk"; NetworkCredential _myCredentials = new NetworkCredential("user", "password", "https://intranet"); ClientContext

Authenticate network credential to access SharePoint site on client object model

点点圈 提交于 2020-02-02 06:22:34
问题 I am working to small app, that is require to bring all users in all groups of given site. I have two sites; SharePoint 2010 running on premisses and SharePoint 2013 online. I am getting credential error... {"The remote server returned an error: (401) Unauthorized."} code. public class Program { static void Main(string[] args) { string _siteURL = "https://intranet.co.uk"; NetworkCredential _myCredentials = new NetworkCredential("user", "password", "https://intranet"); ClientContext

NetworkCredential error in ASP.NET

…衆ロ難τιáo~ 提交于 2020-01-14 08:35:09
问题 I am trying to access a webpage through ASP.NET using the NetworkCredential class. However I keep getting an exception with the following message System.Security.Cryptography.CryptographicException: The handle is invalid Below is my code on how I am trying to call the function. Any help is greatly appreciated. C#: System.Net.WebClient client = new System.Net.WebClient(); client.Credentials = new System.Net.NetworkCredential("Admin", "Nimda"); Stack Trace [CryptographicException: The handle is

NetworkCredential working for POST but not GET

我们两清 提交于 2020-01-05 12:15:24
问题 I'm calling a webAPI web service that uses windows authentication. I'm using this code in my development environment since I am developing from a box that is not on the domain. var req = (HttpWebRequest)WebRequest.Create(url); req.Credentials = new NetworkCredential("username", "password", "domain"); req.Method = WebRequestMethods.Http.Post; //or get This works just fine when I do a post, but when I want to do a get it doesn't work. When i visit the url for the get in a web browser it asks

Read Remote File with Access Permissions

佐手、 提交于 2019-12-29 01:29:13
问题 I am trying to read a file on a network server (from a Windows XP machine), which I would normally access by asking for \\ServerName\dirPath\ in the run dialog. Right now, I have to write a program that reads the file off the server and returns some results on my PC. The problem that I'm facing is that the login name on my PC does not have a login account on the server. As a result, I am unable to read the file on the server when I tried: f = open(r'\\server\path\to\file', 'r') I know that I