2008年12月22日星期一

server 2008 安装 Microsoft Loopback Adapter(环回适配器)

为了更好地使用虚机来访问本的资源,所以安装了回路网卡,本来以为server 2008不带Microsoft Loopback Adapter的驱动程序,后来终于找到创建的方法(如下图)
Start -> Computer -> Right-click, Properties -> Device Manager -> Computer Name, Right-click, Add Legacy Hardware -> Next -> Install the hardware I manually select from a list -> Next -> Network Adapters -> Microsoft on the right, Loopback adapter on the left -> Next

2008年12月19日星期五

Dell E6400 成功安装windows server 2008(64bit) & hyper-v

这两天回公司新领了笔记本E6400,CPU P8600[2.4G]支持vt技术,终于可以装上一直心仪的hyper-v玩玩了,以后工作上开发的东西可以在vt虚机上跑了,呵呵。
主要是以太网的驱动不太适合,为了解决这个问题差不多花了一天的时间……
安装过程中其中主要遇到了三个问题:
1、首先是虚拟网卡驱动的安装,装上之后发现不能正常工作,后来发现Server 2008对于无线网卡要新增feature[功能]安装,在服务管理器添加功能选项安装对无线网卡的支持;
2、安装hyper-v角色后发现服务不能正常运行,想起忘了配置BIOS中对VT应用支持的选项,采用Intel的cpu的机器vt支持大部分需要在BIOS中开启;
3、最后遇到最辣手的问题就是以太网卡825XX的驱动安装了,最后去网上找了一个Inter公版的intel_pro1000_130_vista64,试了半天终于强制安装上了82567LM-2型号的驱动,装上后插上网线测试一切正常,强制安装网卡驱动的步骤如下:
右键computer(我的电脑)--properties(属性)--左边栏第一个devicemanager(硬件管理)--找到显卡右键选 updatedriver(升级驱动)--选第2项browse my computer.....----选第2项Let me pick....(选择计算机驱动列表)--have disk(查询)指向你的驱动文件包里的INF文件--找到你的硬件型号安装,出现红字提示选继续……
哈哈,现在继续开始装其他软件和hyper-v虚机了……

因为暂时没时间回公司申请license,临时安装的是msdn下载的server datacenter版本,所以要用命令演出一下激活前使用的有效期……
slmgr.vbs -dli [查看时间]
slmgr.vbs -rearm [增加有效使用时间最高可以180天]

2008年12月17日星期三

Microsoft SQL Server 2005 Service Pack 3 发布了

这次微软Launch Microsoft SQL Server 2005 Service Pack 3相当的低调,没有太多消息宣传!
简体中文x86和x64的下载地址如下:SQL Server 2005 sp3

2008年12月16日星期二

AD某OU目录下用户信息操作vbscript脚本

'CONST ForReading = 1
CONST ForWriting = 2
CONST ForAppending = 8
CONST CONST_ERROR = 0
CONST CONST_WSCRIPT = 1
CONST CONST_CSCRIPT = 2
CONST CONST_SHOW_USAGE = 3
CONST CONST_LIST = 4
Const ADS_SCOPE_SUBTREE = 2
Const ADS_UF_DONT_EXPIRE_PASSWD = 65536
Const ADS_UF_PASSWORD_EXPIRED = 8388608
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D
Const ONE_HUNDRED_NANOSECOND = .000000100
Const SECONDS_IN_DAY = 86400

Dim lastLogin
'''''''''''''''''''''''''
Set objShell = CreateObject("Wscript.Shell")
lngBiasKey = objShell.RegRead("HKLM\System\CurrentControlSet\Control\" _
& "TimeZoneInformation\ActiveTimeBias")
If (UCase(TypeName(lngBiasKey)) = "LONG") Then
lngBias = lngBiasKey
ElseIf (UCase(TypeName(lngBiasKey)) = "VARIANT()") Then
lngBias = 0
For k = 0 To UBound(lngBiasKey)
lngBias = lngBias + (lngBiasKey(k) * 256^k)
Next
End If
Set objShell = Nothing

'''''''''''''''''''''''''
inputOU=inputbox("请输入查询的OU,该OU必须位于" & TARGET_OU & "的下一层,不输入为查询此OU下所有帐号","输入信息")

Outputfile= strDCName1 & "账号列表" & inputOU
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fLog = fso.OpenTextFile(Outputfile & ".csv", ForWriting,TRUE)
fLog.WriteLine "帐号,姓名,工号,公司,部门,最后登陆时间,是否有邮箱,是否停用"

Set rootDSE = GetObject("LDAP://rootDSE")
BaseDN = rootDSE.Get("defaultNamingContext")
DC= replace(BaseDN,"DC=",",")
DC= replace(DC,",,",".")
DC=right(DC,len(DC)-1)

TARGET_OU = "Employee"

if inputOU<>"" then
TARGET_OU=inputOU & ",OU=" & TARGET_OU
end if


Set objConnection = CreateObject("ADODB.Connection")

objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand = CreateObject("ADODB.Command")
Set objCommand.ActiveConnection = objConnection
Set objCommand1 = CreateObject("ADODB.Command")
Set objCommand1.ActiveConnection = objConnection
'on error resume next

objCommand.CommandText = ";(&(objectclass=organizationalUnit));cn,ADsPath;subtree"
Set objRecordSet = objCommand.Execute
if err.number<>0 then
msgbox "无法找到:" & TARGET_OU
end if
wscript.echo "Begin:"
If objRecordSet.RecordCount>0 Then
i = 0
Set OU = GetObject(objRecordSet.Fields("ADsPath").Value)
OUdistinguishedName=OU.distinguishedName
Wscript.Echo OUdistinguishedName
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open "Active Directory Provider"
adoCommand.ActiveConnection = adoConnection

strBase = ""
' Filter on all user objects.
strFilter = "(&(objectCategory=person)(objectClass=user))"
' Comma delimited list of attribute values to retrieve.
strAttributes = "distinguishedName,ADsPath,lastLogonTimeStamp" & ";subtree"
' Construct the LDAP syntax query.
strQuery = strBase & ";" & strFilter & ";" & strAttributes
' Run the query.
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 10000
adoCommand.Properties("Timeout") = 60
adoCommand.Properties("Cache Results") = False
Set adoRecordset = adoCommand.Execute

' Enumerate resulting recordset.
adoRecordset.movefirst
Do Until adoRecordset.EOF
On Error Resume Next
adspath=adoRecordset.Fields("adspath")
ShowMSG adspath
Set objMailbox = GetObject(adspath)
lastName=objMailbox.sn
If(objMailbox.legacyExchangeDN="") Then
mailaddress="无邮箱"
Else
mailaddress=objMailbox.mail
End If
statusflag=objMailbox.AccountDisabled
firstName=objmailbox.givenname
mailNickname=objMailbox.samaccountname
company=objMailbox.company
department=objMailbox.department
Set objDate = adoRecordset.Fields("lastLogonTimeStamp").Value
If (Err.Number <> 0) Then
On Error GoTo 0
dtmDate = #1/1/1601#
Else
On Error GoTo 0
lngHigh = objDate.HighPart
lngLow = objDate.LowPart
If (lngLow < 0) Then
lngHigh = lngHigh + 1
End If
If (lngHigh = 0) And (lngLow = 0 ) Then
dtmDate = #1/1/1601#
Else
dtmDate = #1/1/1601# + (((lngHigh * (2 ^ 32)) _
+ lngLow)/600000000 - lngBias)/1440
End If
End If
lastLogin=dtmDate

fLog.WriteLine mailNickname & "," & lastName & "," & firstName & "," & company & "," & department & "," & lastLogin & "," & mailaddress & "," & statusflag

adoRecordset.MoveNext
i=i+1
Loop

End If

wscript.echo "总计输出账号为:" & i

Sub ShowMSG(strSubMSG)
Wscript.Echo Time & vbTab & strSubMSG
end sub

set adoRecordset=nothing
set adoCommand=nothing
adoConnection.close
set adoConnection=nothing