错误试图绑定到一个AD用户对象时2147463168 [英] Error 2147463168 when trying to bind to an AD User Object

查看:554
本文介绍了错误试图绑定到一个AD用户对象时2147463168的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在Windows 2012(而不是R2和无法升级)AD环境。当我运行下面这段code从VBScript与管理(非管理员)帐户,它运行完美。然而,当我与一个普通用户运行它,我得到一个-2147463168这似乎是一项具有约束力的错误。

 出错时继续下一步
UsuariosLDAP =LDAP://&放大器; objSysInfo.UserNameSet
ObjUser = GetObject的(UsuariosLDAP)
如果Err.Number的<> 0,则
    strTipoError =错误buscando objeto连接LDAP&放大器; CStr的(Err.Number的)及Usuario:与& objSysInfo.UserName
    shell.logevent 1,strTipoError
    Wscript.Quit
如果结束
 

由于它与正常的管理员帐户下运行,我会认为(寻找其他的选项),这是一个权限问题。问题是,这是一个登录脚本被所有用户执行的,所以我有点持怀疑态度的改变上的所有广告对象的权限,除非我真的要的。另一件事是我以前做过类似这几次的东西(查询UserObject与普通用户),它总是工作正常。我不知道在2012年发生了变化,打破这一点。

THX很多提前

解决方案

  //的MessageId:E_ADS_BAD_PATHNAME
//
//的MessageText:
//
//无效的目录路径名传递
//
#定义E_ADS_BAD_PATHNAME _HRESULT_TYPEDEF_(0x80005000L)
 

从ADSErr.h

解码错误

-2147220978风格的数字是32位有符号整数,转换为十六进制计算器。

的Windows错误(短小号)和COM的HRESULT(通常是,但有例外,先从8在0x80040154的)的WinError.h中的定义,但8007nnnn在这里你看看它包含窗口错误编号。

作为一般规则的Windows误差小于65,535(0xFFFF的)。开始0x80000001错误是组件对象模型(COM)的HRESULT。开始0xc0000001错误是NTSTATUS结果。

NTSTATUS错误(通常但不总是以一个C为0xC0000022)在NTSTATUS.H定义。

.h文件是最好的来源,因为它包含可以提供线索,如错误源错误的符号名。的FormatMessage不给的符号名唯一的说明。

您通过下载平台SDK获取这些文件(它的千兆字节) <一href="http://www.microsoft.com/en-us/download/details.aspx%3Fid%3D8279&sa=U&ei=w2IrULDDLsHFmAWbmIHoBg&ved=0CBwQFjAA&usg=AFQjCNHZn9-4f2NnuN9o3UWUsOF3wL7HBQ" rel="nofollow">http://www.microsoft.com/en-us/download/details.aspx%3Fid%3D8279&sa=U&ei=w2IrULDDLsHFmAWbmIHoBg&ved=0CBwQFjAA&usg=AFQjCNHZn9-4f2NnuN9o3UWUsOF3wL7HBQ

如果你只是想这两个文件,​​我有他们在我的SkyDrive这样我就可以参考它们无论我去哪里。 https://skydrive.live.com/redir?resid=E2F0CE17A268A4FA!121

请注意网上的错误(12,000 - 12999)是窗户的错误,但在wininet.h以上也可指定。

有其他.h文件中定义的错误。但是99%是在上述三个

HRESULTS和NTSTATUS codeS结构

在HRESULTS最显著位,并且两个最显著位NTSTATUS被上错误设定。因此HRESULTS开始8上的错误和NTSTATUS开始C对错误。接下来的14或15位是保留的,一些指定机构 - 哪些方面的误差在这是第三个和第四个数字阅读十六进制时。 EG 0xnn07nnnn - 一个HRESULT设施code 7是一个正常的Windows的错误(从COM程序返回 - 因此它返回一个HResult的)。设施codeS在Winerror.h中定义的HRESULTS和NTSTATUS.H为NTSTATUS codeS。它们是不同的。

脱code 0x8003nnnn错误

HRESULTS与设施code 3是指产生HResult包含OLE结构化存储错误(0x0到0xFF的)。这些相同的DOS错误codeS。这些似乎并没有在Windows的头文件和$名单C $ CS是在这篇文章的末尾。

脱code 0x8004nnnn错误

HRESULTS与设施code 4指的HResult包含OLE错误(0x0到到0x1FF),而范围的其余部分(为0x200起)是组件的具体错误,从而使20E从一个组件会从另一个具有不同的意义,以20E组成部分。

这是为什么错误的来源是额外重要的上述0x80040200错误。

脱code 0x8007nnnn错误

与设施code 7 HRESULTS意味着产生HResult包含一个Windows的错误code。你要回去看看Windows的错误code不是HRESULT。

要取消code 0x80070002。从0x意味着它是一个十六进制数中,8表示错误,前7意味着它一窗口错误,而且数量,2的其余部分,是实际的Windows错误

要查找我们需要它以十进制格式的错误。启动计算器(开始 - 所有程序 - 附件 - 计算器),然后选择查看菜单 - 科学,然后查看菜单 - 十六进制。然后输入2。查看菜单 - 十进制。它会说2。

启动命令提示符(开始 - 所有程序 - 附件 - 命令提示符),然后键入

  NET HELPMSG 2
 

和它会说

 该系统找不到指定的文件。
 

或看它在Winerror.h中

  //
//的MessageId:ERROR_FILE_NOT_FOUND
//
//的MessageText:
//
// 该系统找不到指定的文件。
//
#定义ERROR_FILE_NOT_FOUND 2L
 

脱code 0x8019nnnn错误

与设施的0x19 HRESULTS是HTTP错误。 codeS下,16,384(0x4000的)都是一样的HTTP错误,例如HTTP状态404:服务器上不存在的请求的URL是0x80190194(0x194 = 404)。 $ C $ 16,384 CS和更高的BITS特有的。

的DOS错误codeS(用于0x8003nnnn错误)

  code消息
01无效的功能号
02未找到文件
03找不到路径
04打开的文件太多(无柄左)
05访问被拒绝
06无效手柄
07内存控制块破坏
08内存不足
09无效的内存块地址
0A无效的环境
0B格式无效
0℃无效访问模式(开放模式是无效的)
0D无效数据
0E保留
0F无效驱动器指定
10尝试删除当前目录
11不相同的设备
12没有更多的文件
13试图在写保护磁盘写
14未知装置
15变频器未就绪
16未知的命令
17 CRC错误
18坏请求结构长度
19寻道错误
1A未知的媒体类型
1B未找到扇区
1C打印机缺纸
1D写故障
1E读取故障
1F一般故障
20共享冲突
21锁定违规
22无效的磁盘更改
23 FCB不可用
24共享缓冲区溢出
25保留
26无法完成文件操作(DOS 4.x版)
27-31保留
不支持32个网络请求
不听33的远程电脑
网络34重复的名字
35网络名称找不到
36网络忙
37网络设备已不存在
38的NetBIOS命令超出限制
39网络适配器错误
3A不正确的网络响应
3B意外的网络错误
3C不兼容远程适配器
3D打印队列满
3E没有打印文件空间
3F打印文件删除
40网络名称中删除
41访问被拒绝
42网络设备类型不正确
43网络名称找不到
超过44网络名称限制
45超出的NetBIOS会话限制
46暂时中止
47网络的要求不被接受
48打印或磁盘重定向暂停
49-4F保留
50文件已经存在
51版权所有
52无法创建目录项
53失败的INT 24
54太多重定向
55重复的重定向
56密码无效
57参数无效
58网络设备故障
59功能不支持网络(DOS 4.x版)
未安装5A所需的系统组件(DOS 4.x版)
 

设施codeS

  NTSTATUS设施HRESULTS设施
常见的状态值为0x0空为0x0
调试器为0x1 RPC为0x1
Rpc_runtime 0X2 0X2调度
Rpc_stubs 0x3中存储0x3中
Io_error_ code为0x4 ITF为0x4
各种驱动程序0x5-0xf的Win32为0x7
Ntwin32为0x7的Windows地址0x8
Ntsspi 0x9 SSPI 0x9
Terminal_server是0xA安全0x9
Faciltiy_mui_error_ code 0XB控制是0xA
Usb_error_ code 0x10的证书0XB
Hid_error_ code为0x11互联网位于0xC
Firewire_error_ code×12的MediaServer 0xd中
Cluster_error_ code 0x13 MSMQ 0xe
Acpi_error_ code 0×14 SETUPAPI 0xF的
Sxs_error_ code 0x15 SCARD为0x10
交易的0x19 COMPLUS为0x11
Commonlog 0x1A的AAF 0×12
视频0x1b URT 0x13
Filter_manager为0x1C ACS 0×14
监控0x1d Dplay 0x15
Graphics_kernel 0X1E海为0x16
Driver_framework 0x20的SXS 0x17已
Fve_error_ code为0x21 Windows_ce为0x18
Fwp_error_ code输入0x22的Http的0x19
Ndis_error_ code 0x23 Usermode_commonlog 0x1A的
虚拟机管理程序0x35 Usermode_filter_manager为0x1F
IPSEC 0x36数据Backgroundcopy为0x20
Maximum_value 0x37符号配置为0x21
  State_management输入0x22
  元目录0x23
  WindowsUpdate的0X24
  DirectoryService中0x25
  图形0X26
  壳牌0x27
  Tpm_services 0x28
  Tpm_software 0x29
  解放军为0x30
  FVE 0X31
  FWP 0x32
  WinRM的0x33
  NDIS 0x34
  Usermode_hypervisor 0x35
  CMI 0x36数据
  Windows_defender为0x50
 

I'm working on a Windows 2012 (NOT R2 and can't upgrade) AD environment. When I run the following piece of code from vbscript with an admin (not administrator) account, it runs perfectly. However when I run it with a normal user, I get a -2147463168 which seems to be a binding error.

On error Resume next
UsuariosLDAP = "LDAP://" & objSysInfo.UserNameSet
ObjUser = GetObject(UsuariosLDAP)
If err.number <> 0 then
    strTipoError = "Error buscando objeto en LDAP " & CStr(Err.Number) & " Usuario:" &    objSysInfo.UserName
    shell.logevent 1, strTipoError 
    Wscript.Quit
end if    

As it runs correctly with an admin account, I'll assume (looking for other options), that this is a permissions issue. The thing is that this a login script to be executed by all users, so I'm a bit leery of modifying permissions on all AD objects unless I really have to. The other thing is I've done something similar to this several times before (query a UserObject with a normal user) and it's always worked correctly. I'm not sure what has changed in 2012 to break this.

Thx a lot in advance

解决方案

// MessageId: E_ADS_BAD_PATHNAME
//
// MessageText:
//
//  An invalid directory pathname was passed
//
#define E_ADS_BAD_PATHNAME               _HRESULT_TYPEDEF_(0x80005000L)

From ADSErr.h

Decoding Errors

-2147220978 style numbers are 32 bit signed integers, convert to hex with calculator.

Windows errors (smallish numbers) and COM HResults (typically, but with exceptions, start with an 8 as in 0x80040154) are defined in WinError.h, except 8007nnnn where you look up the Window error number that it contains.

As a general rule Windows errors are less than 65,535 (0xFFFF). Errors starting 0x80000001 are Component Object Model (COM) HResults. Errors starting 0xc0000001 are NTStatus results.

NTStatus errors (typically but not always start with an C as in 0xC0000022) are defined in NTStatus.h.

.h files are the best source because it includes the symbolic name of the error which can give clues such as the source of the error. FormatMessage doesn't give the symbolic name only the description.

You get these files by downloading the Platform SDK (it's gigabytes) http://www.microsoft.com/en-us/download/details.aspx%3Fid%3D8279&sa=U&ei=w2IrULDDLsHFmAWbmIHoBg&ved=0CBwQFjAA&usg=AFQjCNHZn9-4f2NnuN9o3UWUsOF3wL7HBQ

If you just want the two files I have them on my skydrive so I can reference them anywhere I go. https://skydrive.live.com/redir?resid=E2F0CE17A268A4FA!121

Note internet errors (12,000 - 12,999) are windows errors but are specified in wininet.h also available above.

There are errors defined in other .h files. But 99% are in the three above.

Structure of HResults and NTStatus Codes

The most significant bit in HResults, and the two most significant bits in NTStatus are set on error. Hence Hresults start 8 on error and NTStatus starts C on Error. The next 14 or 15 bits are reserved and some specify the facility - what area the error is in. This is the third and fourth number when reading hex. EG 0xnn07nnnn - An HResult facility code 7 is a normal Windows' error (returned from a COM program - hence it's returned as a HResult). Facility codes are defined in Winerror.h for HResults and NTStatus.h for NTStatus codes. They are different.

To Decode 0x8003nnnn Errors

HResults with facility code 3 means the HResult contains OLE Structured Storage errors (0x0 to 0xff). These are the same as Dos error codes. These don't seem to be in Windows' header files and the list of codes is at the end of this post.

To Decode 0x8004nnnn Errors

HResults with facility code 4 means the HResult contains OLE errors (0x0 to 0x1ff) while the rest of the range (0x200 onwards) is component specific errors so 20e from one component will have a different meaning to 20e from another component.

This is why the source of the error is extra important for errors above 0x80040200.

To Decode 0x8007nnnn Errors

HResults with facility code 7 means the HResult contains a Windows' error code. You have to look up the Windows' error code not the HResult.

To decode 0x80070002. The 0x means it's a hexadecimal number, the 8 means error, the first 7 means it a windows error, and the rest of the number, 2, is the actual Windows error.

To look up the error we need it in decimal format. Start Calculator (Start - All Programs - Accessories - Calculator) and choose View menu - Scientific, then View menu - Hex. Enter 2. Then View menu - Decimal. It will say 2.

Start a Command Prompt (Start - All Programs - Accessories - Command Prompt) and type

net helpmsg 2

and it will say

The system cannot find the file specified.

or look it up in winerror.h

//
// MessageId: ERROR_FILE_NOT_FOUND
//
// MessageText:
//
// The system cannot find the file specified.
//
#define ERROR_FILE_NOT_FOUND             2L

To Decode 0x8019nnnn Errors

HResults with facility 0x19 are HTTP errors. Codes under 16,384 (0x4000) are the same as HTTP errors, eg HTTP status 404: The requested URL does not exist on the server is 0x80190194 (0x194 = 404). Codes 16,384 and higher are BITS specific.

Dos Error Codes (for 0x8003nnnn errors)

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 

Facility Codes

NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 

这篇关于错误试图绑定到一个AD用户对象时2147463168的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆