Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clearing a cached handle in script

59 views
Skip to first unread message

Richard Glenn

unread,
Aug 18, 2003, 4:15:55 PM8/18/03
to

>-----Original Message-----
>Richard Glenn wrote:
>> When I run a WMI script against a remote computer using
>> alternate credentials:
>> Set objSWbemLocator = CreateObject
>> ("WbemScripting.SWbemLocator")
>>
>> Set objSWbemServices = objSWbemLocator.ConnectServer
>> (strComputer, "root\cimv2", strAcct, strPass)
>>
>> It works if I specify the correct account and password
>> the first time, however if I specify an incorrect
account
>> and password, and then loop and specify the correct
>> account and password, it fails, even if I set the
>> objSWbemServices = NOTHING.
>>
>> Does anyone know how to clear the credentials used the
>> first time so I can then specify the correct
credentials?
>
>
>I suggest you repost the question to
microsoft.public.win32.programmer.wmi
>
>Have you tried creating a new SWbemLocator instance?
>
>
>--
>Michael Harris
>Microsoft.MVP.Scripting
>
>Windows 2000 Scripting Guide
>Microsoft® Windows®2000 Scripting Guide
>http://www.microsoft.com/technet/scriptcenter/scrguide/sa
gsas_overview.asp
>
>System Administration Scripting Guide - samples scripts
>http://www.microsoft.com/downloads/release.asp?
ReleaseID=38942
>
>WSH 5.6 documentation download
>http://www.microsoft.com/downloads/details.aspx?
FamilyId=01592C48-207D-4BE1-8A76-
1C4099D7BBB9&displaylang=en
>
>.
>

[MS] Scott McNairy

unread,
Aug 18, 2003, 4:43:32 PM8/18/03
to
I am unable to repro this problem. Can you detail which OS and Service Pack
you are remoting to and from? Also can we see what other code you are
running in your script? We might be able to tell more from that...

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Richard Glenn" <NoS...@NoSpam.net> wrote in message
news:045801c365c5$87aa6640$a301...@phx.gbl...

James Bond

unread,
Sep 11, 2003, 11:25:12 AM9/11/03
to
Hello I am having the same troubles. We have different (@ 5 - 6
)combinations of username/pwd for about 50 machines, updated every
week. So, I tried to read it from a file and loop through until I get
success. But if I use the correct credentials in first line, I get
through the rest of the code, otherwise I get access denied. I tried
Set objSWbemServices = Nothing or objSWbemServices = Nothing, but
nothing works.
Because I could not find any help, in desparation I have posted my
separate message.

I really need to resolve this, can someone help. Hey Richard, if you
find any solution, can you ple. let me know? I will do the same.

thanks a lot,
Snehal

"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message news:<3f413a74$1...@news.microsoft.com>...

Ivan Brugiolo [MSFT]

unread,
Sep 11, 2003, 12:36:52 PM9/11/03
to
Sure you are not hitting the intentional slow-down for repeated failed logon
attempts ?

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"James Bond" <bonds...@hotmail.com> wrote in message
news:f61fbd6f.03091...@posting.google.com...

Daniel Pravat [MSFT]

unread,
Oct 8, 2003, 8:20:14 PM10/8/03
to
I don't know if this was was answered or not. Anyway,

You can pick a free port, open it on firewall and use it as port range or
static port for
Winmgmt COM component (you need to use dcomcnfg.exe tool to do that).
DCOM client will use 135 to get the initial OXID for the IWbemServices
pointer
and the resolver will open your designed port on the first call into it.


--
This posting is provided "AS IS" with no warranties, and confers no rights.

Use of included script samples are subject to the terms specified at

news:f61fbd6f.03092...@posting.google.com...
> Ivan,
> Infact, I resolved the issue, I had before. Yes, I occasionally get
> slow response. But it works. How I resolved is, use Err.Clear before I
> make an attempt.
>
> Thanks very much for the help everyone.
>
> But I ran into another (which is serious) issue now. We took that
> machine out of our firewall. Scenario is this.
> We have machine A that has our DLL which authenticates all other
> machines of our company. Before I had that machine inside firewall,
> and it could connect each machine within our network with Admin
> credential. As our employee(s) sometime go out to client site, we
> tried to simulate firewall connectivity. I refered to
> http://www.microsoft.com/com/wpaper/dcomfw.asp article and our network
> admin setup firewall for port 135 from Machine A outside to anymachine
> inside.
> But all the time I get either Access Denied or RPC Server is
> unavailable. I tried to use WBemTest utility and that also gives me
> RPC Error. We don't get any error traffic on log.
> I am clueless. My program is suddenly in few days worthless, because
> if this doesn't work, we cannot use it.
>
> I will really appreciate any help
>
> Many thanks,
> Snehal
>
>
> "Ivan Brugiolo [MSFT]" <ivan...@online.microsoft.com> wrote in message
news:<#ijqoLIe...@TK2MSFTNGP12.phx.gbl>...

0 new messages