• 為何在Windows 2008 Server / Vista 無法使用 Net Send 傳遞訊息?

    在 Windows 2008  及 Vista 已經將此 Messenger Service 及Net Send 功能移除.此為 By design,但還有另一個指令 msg一樣可以達成您傳遞訊息給特定帳號的功能

    MSG command:

    將訊息傳送給使用者。

    MSG {username | sessionname | sessionid | @filename | *}
        [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

      username            識別指定的使用者名稱。
      sessionname         工作階段名稱。
      sessionid           工作階段識別碼。
      @filename           識別內含使用者名稱、工作階段名稱
    及工作階段識別碼清單的檔案,以便傳送訊息。
      *                   傳送訊息到指定伺服器的所有工作階段。
      /SERVER:servername  要連線的伺服器 (預設值是目前的伺服器)。
      /TIME:seconds       時間延後以等候接收者識別 msg。
      /V                  顯示執行動作的資訊。
      /W                  等候使用者回應,可和  /V 一起使用。
      message             要傳送的訊息。如果沒有指定,會顯示提示
    或從 stdin 讀取。

    範例:

    msg  *  /server:PCName(or PC_IP)  /Time:60 Hello! How are you?

    其中:

    使用/Time 參數.可以依據您需要設定時間(秒) 顯示訊息

    msg  *  /server:PCName(or PC_IP)  /W Hello! How are you?

    其中:

    使用 /W 需要前端user 回應此訊息. 其發送訊息Msg 視窗會需要等待User點[確認] 回應才會結束.

    Client 收到的訊息:

    clip_image002

  • 除了AD授權還原以外如何快速恢復誤刪除的電腦或使用者帳號

    AdRestore v1.1
    By Mark Russinovich
    Published: November 1, 2006
    Introduction
    Windows Server 2003 introduces the ability to restore deleted ("tombstoned") objects. This simple command-line utility enumerates the deleted objects in a domain and gives you the option of restoring each one. Source code is based on sample code in the Microsoft Platform SDK. This MS KB article describes the use of AdRestore:
    下載位置
    <http://technet.microsoft.com/en-us/sysinternals/bb963906.aspx>

    若是您知道電腦或使用名稱,Adrestore.exe可以比較快速恢復
    使用方法adrestore -r ObjectName

  • DS - 當您執行 "gpresult" 指令時發生 Access Denied 錯誤

    徵狀:
    ================
    1. 您打開 DOS 執行 "gpresult" 後得到 "Access Denied" 錯誤
    2. 您執行 "gpupdate" 沒有問題,GPO套用成功
    3. 您發現同一個 OU 下的其它台伺服器沒有這個問題。
    4. 執行以下測試問題都無法解決。
        A. Use "klist purge" command to purge all Kerberos tickets, run "gpresult /V", do you still get "Access Denied" error?
        1. Download and install "Windows Server 2003 Resource Kit Tools" for the klist tool http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
        B. Delete existing "JeffreyAdmin" user profile, logon as JeffreyAdmin again to re-create user profile, run "gpresult /V", do you still get "Access Denied" error?
        C. Select a testing domain user and configure it as local admin (make sure the user does not have user profile on this server already), run "gpresult /V", do you still get "Access Denied" error?
        D. Isolate the server into a new OU
            1. Create a new OU and disable GPO inheritance on this OU.
            2. Move the computer object into this OU
            3. Logon to server as Domain Admin, run gpupdate /force
            4. Rebbot the server, does the problem still persists?
        E. Reboot the server into safe mode with network and run "gpresult /V", do you still get "Access Denied" error?
        F. Collect netmon trace and process monitor while running the "gpresult /V" to reproduce the "Access Denied" error
        G. Reset security settings back to the defaults <http://support.microsoft.com/kb/313222>
         secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose

    解決方法
    ================
    1. Verify the default permissions for the RSOP namespace in WMI Management Console are correct.
    325353 HOW TO: Set WMI Namespace Security in Windows Server 2003 http://support.microsoft.com/?id=325353

    2. 依照以下步驟重建 WMI

    -Open a console window (cmd) and change to the WBEM folder (cd "%windir%\system32\wbem").
    -Carefully enter the following command to ensure that all of the WBEM DLLs are properly registered.

    for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s

    -Also enter the following command to ensure that the provider host is properly registered.

    wmiprvse /regserver

    3. Stop the WMI service and rename the repository folder (WMI database) by entering the following commands. (WARNING: This step can potentially cause data loss. Read "Background Information" below for an alternative approach.)

    if exist "repository.old" rmdir /s/q "repository.old"
    net stop winmgmt /y
    rename "repository" "repository.old"
    net start winmgmt

    -The above commands will cause WMI to rebuild the repository. After executing the above commands you should wait a few minutes (5 or so) before proceeding to give the rebuild process a chance to complete.

    << BACKGROUND INFORMATION >>
    Renaming the repository folder causes WMI to rebuild the database. This can have some negative impact on the system. This is especially true if an application has stored static data in the repository. As an alternative to rebuilding the repository you can try manually recompiling all of the default WMI MOFs and MFLs using the following command. (Note: This can take a while to complete.)

    for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

    -In either case, if the system in question hosts Exchange 2000 you should also run the following additional commands after the WMI service is verified to be back up and stable (see below). Once again, all of these commands are executed from the %windir%\system32\wbem folder.

    mofcomp exwmi.mof
    mofcomp -n:root\cimv2\applications\exchange wbemcons.mof
    mofcomp -n:root\cimv2\applications\exchange smtpcons.mof
    mofcomp exmgmt.mof

    4. Verify that the WMI service is back up by using WBEMTEST to execute a WMI query against the CIMV2 namespace.
    a. Start -> Run -> Open : WBEMTEST
    b. Click "Connect"
    c. Enter "root\cimv2" for namespace and click "Connect"
    d. Click "Enum Instances..."
    e. Enter "Win32_OperatingSystem" and click "OK"
    f. Double click on the returned instance to view data
    g. Click "Close", click "Close", click "Exit"

    -The above test ensures that the repository was successfully rebuilt. As an alternative to the above test you could also simply execute the following VBS script (i.e. cscript os.vbs).

    set WMI = GetObject("WinMgmts:")
    set objs = WMI.InstancesOf("Win32_OperatingSystem")
    for each obj in objs
    WScript.Echo obj.GetObjectText_
    next

    -If you receive errors with the above script (or WBEMTEST procedure) you can try manually recompiling all of the MOFs and MFLs as described in Step 3 (above).

    6. From the console prompt (in %windir%\system32\wbem folder), ensure that the RSOP namespaces are rebuilt by executing the following commands.
    mofcomp rsop.mof
    mofcomp rsop.mfl

    << BACKGROUND INFORMATION >>
    The RSOP classes depend on the corresponding providers being properly registered under HKEY_CLASSES_ROOT\CLSID. These providers are as follows.

    - Rsop Planning Mode Provider
    %SystemRoot%\system32\rsopprov.exe
    CLSID = {F0FF8EBB-F14D-4369-bd2e-d84fbf6122d6}

    - Rsop Logging Mode Provider
    %SystemRoot%\system32\userenv.dll
    CLSID = {B3FF88A4-96EC-4cc1-983F-72BE0EBB368B}

    7. Change to the SYSTEM32 folder (cd "%windir%\system32") and execute the following command to make sure that the RSOP providers are properly configured.

    regsvr32 /n /i userenv.dll

    8. Reboot system.

  • SCOM Reports are not showing up

    PROBLEM:
    ==========
    SCOM Reports are not showing up

    image

    CAUSE:
    =======
    The above Event Error 31565 can come if the Column 'TopLevelHostManagedEntityRowId‘ is missing in the ManagedEntity table under OperationsManagerDW database.
    This 'TopLevelHostManagedEntityRowId' column is available in Sp1 RTM version of  OperationsManagerDW database, if its lower than Sp1 version then the column will not be there.
    Because OperationsManager database is at Sp1 version and OperationsManagerDW database is still at RTM version and not at Sp1 version, the Data transfer is failing and above error is generated.
    In some cases if OperationsManagerDW database is created using DBCreateWizard of OpsMgr 2007 RTM Media source and not yet upgraded to OpsMgr 2007 Sp1, then above column will be missing.

    SOLUTION:
    ==========
    Upgrade the OperationsManagerDW (OpsMgr 2007 Reporting) database to Sp1 version using OpsMgr 2007 Upgrade wizard and select to upgrade OpsMgr 2007 Reporting component.
    Restart all the SQL services on database server and all the 3 services for OpsMgr on RMS server.
    After waiting for few minutes, all the reports will be started showing up in Reporting pane of Operations Console fine and also all the reports will start showing data fine.

    More Information
    ============
    The above Event Error 31565 can come if the Column 'TopLevelHostManagedEntityRowId‘ is
    missing in the ManagedEntity table under OperationsManagerDW database.
    This 'TopLevelHostManagedEntityRowId' column is available in Sp1 RTM version of OperationsManagerDW database, if its lower than Sp1 version then the column will not be there.

    clip_image003

  • 為何XP / Vista 會收不到MSG 傳遞的訊息,出現存取被拒?

    clip_image002

    Windows XP SP2 之後,預設RemoteRPC 為關閉, 針對 XP, Vista  需要增加AllowRemoteRPC機碼.將此功能打開.

    如此PC 就可以收到此訊息,以下為此機碼資訊

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
    "AllowRemoteRPC"=dword:00000001