使用NAS存储器中存储的驱动程序安装网络打印机时出现问题 [英] Problem installing network printers using drivers stored on a NAS storage
问题描述
问候大家,
我试图使用管理员用户安装网络打印机,但收到错误消息(操作无法完成,错误0x00000032),当我搜索此错误消息时,我发现这意味着该用户未通过身份验证即可安装打印机,但我确定用户是admin且密码正确.
情况是:
1-使用用户名&打开与NAS存储的网络连接.密码,以便能够读取打印机驱动程序.
2-使用域管理员用户创建TCP/IP端口.
3-使用域管理员用户安装打印机.
代码:
Greetings everybody,
I''m trying to install a network printer using an administrator user but I''m getting the error message (Operation couldn''t be completed error 0x00000032), when I searched for this error message I found that it means that the user is not authenticated to install the printer but I''m sure the user is admin and the password is correct.
The scenario is:
1-Open a network connection to the NAS storage using username & password to be able to read the printers drivers.
2-Create TCP/IP Port using domain admin user.
3-Install the printer using domain admin user.
The Code:
public Form1()
{
InitializeComponent();
//Open Connection to NAS Storage when form loads >> Step 1
ProcessStartInfo P = new ProcessStartInfo();
P.FileName = "net";
P.Arguments = "use \"\\\\10.11.3.133\\CIB Library\" /user:username password";
P.CreateNoWindow = true;
P.UseShellExecute = false;
Process.Start(P);
}
private void Test_Click(object sender, EventArgs e)
{
//Using Credentials
SecureString password = new SecureString();
foreach (char c in "xyz") password.AppendChar(c);
//Create Printer TCP/IP port >> Step 2
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "cscript";
info.Arguments = @"c:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.17.10.176 -h 10.17.10.176 -o raw";
info.UserName = "username";
info.Password = password;
info.Domain = "domain";
info.UseShellExecute = false;
info.CreateNoWindow = true;
Process.Start(info);
//Install the printer >> Step 3
string _systemRoot = Environment.GetEnvironmentVariable("SYSTEMROOT");
string _system32 = Environment.GetEnvironmentVariable("SYSTEMROOT") + @"/System32";
info.WorkingDirectory = _system32;
info.FileName = _system32 + @"/RUNDLL32";
info.Arguments = "printui.dll, PrintUIEntry /if /b \"HP LaserJet 4250n\" /f \"\\\\10.11.3.133\\CIB Library\\Drivers\\Printers XP\\HP\\HP 4250 CD\\Drivers\\i386(32 bit - 2000_XP_S2003_Vista)\\PS\\hpc4x50d.inf\" /r \"IP_10.17.10.176\" /m \"HP LaserJet 4250 PS\"";
info.UserName = "username";
info.Password = password;
info.Domain = "domain";
info.UseShellExecute = false;
info.CreateNoWindow = true;
Process.Start(info);
}
我认为问题是我在代码的打印机安装部分中使用的域凭据与用于连接到打印机驱动程序所在的NAS存储的凭据之间存在冲突,因为创建TCP/IP端口或安装打印机没有问题使用本地存储的驱动程序.
我希望这可以使您更轻松地解决我的问题
预先感谢您的帮助
I think the problem is a conflict between the domain credentials I use in the printer installation part of the code and the credentials used to connect to the NAS storage where the printer driver locates because I have no problem creating the TCP/IP port or installing printers using local stored drivers.
I hope this makes it easier for you to solve my problem
Thanks in advance for your help
推荐答案
您好,
有趣的问题,在您的环境之外很难找到解决方案.
也许可以解决您的问题的一些想法:
使用printui.dll时要小心操作系统(尽管您编写的操作系统可以与本地存储的驱动程序一起使用):
Win2000/Server 2003:
http://support.microsoft.com/kb/189105 [ http://support.microsoft.com/kb/314486 [ http://technet.microsoft.com/de-de/library/ee624057%28v = ws.10%29.aspx [ ^ ]
知道它确切地卡在哪里会很有帮助,如果在代码的第3步仅"出现,则INF的printui.dll/filepath的凭据/参数一定有问题.如果它可能是凭据问题,那么快速检查是否可以使用某个进程获取一些正常"文件将为您带来良好的回报.这样您就可以尝试其余的内容了.
另外,如果Step2成功完成,我会很安全(也许给Step2一点时间来创建端口).
希望有帮助.
关于
Hi,
interesting problem, not easy to find a solution from outside of your enviroment.
Maybe some ideas to solve your problem:
Take care of your os when using printui.dll (althought you wrote it works with local stored drivers):
Win2000/Server 2003:
http://support.microsoft.com/kb/189105[^]
XP:
http://support.microsoft.com/kb/314486[^]
Win7/Vista/Server 2008:
http://technet.microsoft.com/de-de/library/ee624057%28v=ws.10%29.aspx[^]
It would be a great help to know where it exactly stucks, if it''s "only" at step 3 of your code, there must be something wrong with credentials/arguments of printui.dll/filepath to your INF. A quick check if it works to get some "normal" file using a process would give a good return if it could be a problem with credentials. Then you''re able to try the rest.
In addition I would going safe if Step2 was finished successfully (maybe give Step2 a little time to create port).
Hope that helps.
Regards
我找到了解决问题的方法,方法是在NAS存储上创建一个用户帐户,该帐户具有与域用户相同的帐户名和密码,也可以将NAS存储加入该域.
谢谢
I found the solution of my problem by creating a user account on the NAS storage with the same account name and password of my domain user, also joining the NAS storage to the domain would work.
Thanks
这篇关于使用NAS存储器中存储的驱动程序安装网络打印机时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!