Logoff Script Take 2-3 min

Hi All,
  I have create user logoff script to uninstall software. Now i have two issues.
 1. Take long to logoff
 2. How do i allow only once? 
$ArgumentsStandard =" /quiet "
$ArgumentsStandard +="/norestart"
$App = Get-Content "\\server\share\un-installApp.txt"
#gwmi gets the list of applications
# where selects just the apps im interested in removing
# start-process removes each app using msiexec with quiet and norestart options
Write-Host "start un-installing software from list"
gwmi win32_product |
where { $App -contains $_.Name } |
ForEach-Object {
Write-Host "start un-installing $_.name"
$Arguments = "/uninstall "
$Arguments += $_.IdentifyingNumber
$arguments += $ArgumentsStandard
Start-Process "MSIExec" -ArgumentList $Arguments -wait

Hi Martin,
  I don't know how to do this in PowerShell So can you help me with the if  code? 
if exist "c:\cid3.txt" goto end
$ArgumentsStandard =" /quiet "
$ArgumentsStandard +="/norestart"
$App = Get-Content "\\server\Softwareshare\un-installApp.txt"
#gwmi gets the list of applications 
# where selects just the apps im interested in removing 
# start-process removes each app using msiexec with quiet and norestart options 
Write-Host "start un-installing software from list"
gwmi win32_product | 
where { $App -contains $_.Name } |
ForEach-Object {
Write-Host "start un-installing $_.name"
$Arguments =  "/uninstall "
$Arguments += $_.IdentifyingNumber
$arguments += $ArgumentsStandard 
Start-Process "MSIExec" -ArgumentList $Arguments -wait
New-Item c:\cid3.txt -type file
:end

Similar Messages

  • The installation of avid studio on my mac does noet work, how do I solve this problem. It takes approx 50 min before the MAC starts

    I try to install AVID studio on my IMAC, First I installed Parallels and Windows 8. If i want tot install AVID studio the IMAC takes very long to start up. On My windows PC installation of AVID takes approx 20 min. On my MAC i wait and wait until the end the installaion stops and nothin happends (50 a 60 min). Who can solve this problem.
    regards
    Kees

    Are there any dialog boxes popping up behind your Yahoo screen?
    I have intermittent problems attaching files in Yahoo mail and this is usually the reason.  I'm also using an iMac (10.7.3) and this is likely the problem.
    It is generally a Yahoo issue rather than a Mac problem.

  • I have synced a family members iphone to my accont on itunes! how do i take it off mine and sync it to his account?

    i have synced a family members iphone to my accont on itunes! how do i take it off mine and sync it to his account?

    Try this site - they are free
    http://www.zedge.net/

  • How to create and add a logon/logoff script to populate last user into the computer field in AD

    Hi All,
    Bit stuck here,
    Not sure what forum to put this is as it involves different subjects,
    I work in a Server 2008 RT environment and have access to Active Directory etc.
    I saw this a few weeks ago - http://ivan.dretvic.com/2012/10/automatically-generate-description-field-for-computers-in-active-directory/
    Now, I'm not particularly sure what to do here, I don't know how to create a group policy etc. How to implement it in a test environment etc. Never done this before.
    Can somebody give me a step by step guide on literally everything that would be involved in this?
    Or any links that may be able to help?
    I basically want the AD to show who was the last user that logged into a specific client when the client named is searched for in the Computers OU, and if possible being able to pull the make/model and serial number from the client aswell.
    If possible there should be a way of including this with the existing login script that we already have, how can I do this?
    I've tried a few so far and got stuck, I have domain admin priveledges also.
    Thanks,
    Regards, Max.

    Hi Max,
    Please refer to the following article to learn how to create a logon/logoff script via GPO:
    Assign User Logon Scripts
    Assign User Logoff Scripts
    As for the issues about script, this is the forum to discuss questions about driectory service, better to post your question to the forum for Script:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=scripting
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or
    learn from your interaction with us.
    Thank you for your understanding.
    Regards,
    Lany Zhang

  • Help! How can I take out the mini-disc stuck in mac?

    Help! How can I take out the mini-disc stuck in mac?
    I insert it into the mac, but the OS cannot load the disc and the disc cannot be ejected even i pressed the "eject" button.

    This happened to a family members macbookpro. A mini-cd inserted, couldn't be mounted or ejected by the drive.
    I cut a rectangle from a cereal box about two inches wide and 6 inches long. Abour an inch and half from one end in the middle I cut a notch and bent it down a little.
    I................I
    I................I
    I....I__I....I
    I................I
    I................I
    I................I
    I................I
    I................I
    I................I
    I................I
    I................I
    I................I
    I________I
    I then inserted it slowly into the drive notch down and slowly pulled out. I did this few times and caught the mimi-cd and removed it. The drive has worked flawlessly for several years
    A few days after this happened I was in BestBuy and an Apple rep was there displaying new Apple products. I asked him about it and he said they have a tool that ***** it out.

  • Iso 5 the app store is working very slow, takes about 2 min to search....

    iso 5 the app store is working very slow, takes about 2 min to search....

    iso 5 the app store is working very slow, takes about 2 min to search....

  • Shutdown from a logoff script

    I have created a GPO that calls a  logoff script.  This script looks for other batchfiles and executes them.  I am using this method install an applications and then reboot.  However, when the batch file runs
    shutdown -r  -f -t 0, I get device not ready.  I there any way to either force a reboot from a logoff script? Or a way to abort the logoff when I am installing the app then force a reboot then? 

    What about using this only : shutdown -r  -f ?
    Does it works?
    Arnav Sharma | Facebook |
    Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members
    reading the thread.

  • ShockwaveFlashObject10.1.82.76. MSN + email takes 10-20 min to load

    Shockwave  was installed 9/6/10. Computer print, all programs and icons are smaller. MSN sometimes takes 10-20 min. load. Often I can't get my
    emails. When I try to close MSN, when it is stalled in loading I can't and have to use Ctrl-Alt-Delete, which is a lengthy process. My Hotmail and Internet Explorer load in 2-3 min.
    I have called Qwest my internet provider, MSN Partners, and Microsoft. They all believe that I need to uninstall and reinstall Shockwave.
    I have Windows XP,Media Center Edition, Version  2002, Service Pack 3, 76487-OEM-0011903-00825, I don't know how to find the amt. of bits.
    Internet Explorer 8 has 128 bits.
    I tried to scan and email via HP Solutions. A box came up and said MSN couldn't handle this( not exact words).
    As you can discern I don't know much about computers, only enough to be dangerous and enough to be afraid of them.
    Hope you will help.
    Nurse78

    ShockwaveFlashObject 10.1.82.76 is actually Flash Player, not Shockwave Player.
    I suggest that you uninstall Flash Player using the uninstaller from http://kb2.adobe.com/cps/141/tn_14157.html, then reinstall the latest Player http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player_ax.exe
    Make sure that no Internet Explorer windows are open when you run the uninstaller & installer.
    If you still have problems after this, please post in the Flash Player forum http://forums.adobe.com/community/webplayers/flash_player

  • It takes about 10 min to activate fire fox browzer afier clicking the icon

    my operating system is windows 7 home premium. Fire fox installed is 6.0.1
    The fire fox browser takes about 10 min to be displayed after clicking the browser icon on my desk top.

    In order to diagnose your problem you will need to download and install the below
    Try clicking the tap problematic apps while the trace is running
    Install the WPT (windows Performance Toolkit) 
    http://www.microsoft.com/en-us/download/details.aspx?id=30652
    Help with installation (if needed) is here
    When you have, open an elevated command prompt and type the following 
    WPRUI.exe (which is the windows performance recorder) and check off the boxes for the following:
    First level triage, CPU usage, Disk IO.  
    If your problem is not CPU or HD then check off the relevant box/s as well (for example networking or registry)  Please configure yours as per the below snip
    Click Start
    Let it run for 60 secs or more and save the file (it will show you where it is being saved and what the file is called)
    Zip the file and upload to us on Onedrive (or any file sharing service) and give us a link to it in your next post.
    Wanikiya and Dyami--Team Zigzag

  • Logoff script is not completing on computers in remote locations

    Hi folks,
    We're running a logoff script on our Win7 Enterprise SP1 machines that invokes three robocopy statements which copy various local directories to our Netapp as a backup. The logoff script is called through GP at 'User Configuration|Policies|Windows Settings|Scripts
    (Logon/Logoff)'.
    If the machine is in the corporate office, there is no trouble, the script completes, and all files are copied. If the machine is located at our branch office (connected across the WAN via an IPSEC tunnel), or by Directaccess, the third robocopy statement
    will not complete, and the logoff script just exits as the user is logged off. The robocopy log is truncated in the middle of the copy. This script can be run interactively and it will complete without difficulty. It would seem that the copy is taking
    too long to complete?
    In researching this, I found that the default time allowed  for a logon/logoff/startup/shutdown script to complete is 10 minutes, and that this can be changed through GP at 'Computer Configuration|Policies|Administrative Templates|System|Scripts|Maximum
    wait time for group policy scripts'. The trouble is that even in remote locations, the script fails way before that default 10 minute timeout. In fact, the script runs slightly less than a minute before the logoff occurs. I tried setting the max wait time
    to 0 (infinite time), but that did not help.
    I've also tried breaking the three robocopy commands out into separate batch files and invoking each with a 'call' statement, and adding 'start /wait' in front of each command, but neither of those worked either.
    Does anyone have a clue why the logoff script is exiting so quickly? Thanks for any help,
    ianc

    Do your robocopy statements log to a file?  It may be worth while to tweak your batch scripts a bit to generate a log.
    @echo off
    echo. & echo Backing up Data Set 1 - Please Wait ...
    @echo %date% %time% - Starting Robocopy 1 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source1 destination1 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 1 of 3 >> C:\Logoff.log
    echo. & echo Backing up Data Set 2 - Please Wait ...
    @echo %date% %time% - Starting Robocopy 2 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source2 destination2 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 2 of 3 >> C:\Logoff.log
    echo. & echo Backing up Data Set 3- Please Wait ...
    @echo %date% %time% - Starting Robocopy 3 of 3 >> C:\Logoff.log
    robocopy /s /w /i /t /c /h /e /s source3 destination3 /log+:C:\Logoff.log
    @echo %date% %time% - Finished Robocopy 3 of 3 >> C:\Logoff.log
    echo. & echo Finished Backing Up Data!
    @echo %date% %time% - Exiting Script >> C:\Logoff.log
    exit /b
    Depending on the results of that, you may want to consider maybe creating a different script to perform some tests to validate network connectivity.  The example below is a bit over the top but we ended updoing something similar to what's below for
    testing remote connections, especially when users had intermittent connectivity problems.  (Hence the goto top)
    @echo off
    set ExternalHosts=www.yahoo.com www.google.com www.msn.com www.aporter.com %gateway%
    set InternalHosts=someserverhostname1 some.server.IP.Address1 someserverhostname2 some.server.IP.Address2
    set logfile=C:\ExternalNetworkTest-PathPing.txt
    if exist "C:\windows\system32\pathping.exe" (
    set ptcmd=pathping -n %%i
    set trace=0
    ) else (
    echo %date% %time% Pathping does not exist on this machine - relying on ping and trace >> %logfile%
    set ptcmd=ping -n 10 %%i
    set trace=1
    echo ********************************************* >> %logfile%
    date /t >> %logfile%
    echo ********************************************* >> %logfile%
    echo. >> %logfile%
    :TOP
    for %%i in (%ExternalHosts%) do (
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %ptcmd% >> %logfile%
    if /i %trace%==1 CALL: TRACE %%i
    CALL :GETIPINFO %logfile%
    for %%i in (%InternalHosts%) do (
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %ptcmd% >> %logfile%
    if /i %trace%==1 CALL: TRACE %%i
    CALL :GETIPINFO %logfile%
    rem CALL :GETIPINFO %logfile%
    echo. >> %logfile%
    rem you could have it loop but for this test
    rem that is not necessary for you
    rem GOTO TOP
    rem goto end
    :CURDT
    set hh=
    set hhmmss=
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%
    set hhmmss=%hh%:%time:~3,2%:%time:~6,2%
    echo %hhmmss% >> %1
    GOTO :EOF
    :TRACE
    set tracecmd=tracert -d %1
    CALL :CURDT %logfile%
    echo ********************************************* >> %logfile%
    %tracecmd% >> %logfile%
    GOTO :EOF
    :GETIPINFO
    ipconfig /allcompartments /all >> %1
    rem Get IP Adddress
    for /f "usebackq tokens=15" %%a in (`ipconfig ^| find /i "IP Address"`) do set ip=%%a
    rem echo %date% %time% IP Address is %ip% >> %logfile%
    rem echo %date% %time% IP Address is %ip% >> %1
    rem Get Gateway
    for /F "usebackq tokens=13" %%i in (`ipconfig ^| find /i "gateway"`) do set gateway=%%i
    rem echo %date% %time% Gateway is %gateway% >> %logfile%
    rem echo %date% %time% Gateway is %gateway% >> %1
    GOTO :EOF
    :END
    echo %date% %time% exiting script >> %logfile%
    exit /b

  • Logoff script terminated prematurely on windows 7

    I have a logoff script that backup the user profile, it works fine on all but one computer, it seems that the script is just killed but I can't figure out why
    I already changed MaxGPOScriptWait to 0 and gpssvc PreshutdownTimeout to ffffffff and I also see winlogon warnings 6005, 6006, user profile service 1530 and user32 1073

    Hi,   
    We can use the gpresult /h GPReport.html command to generate a Resultant Set of Policy (RSoP) report. We could check if the policy setting gets applied successfully from the report. Besides, can you run the
    script manually on the computer?
    In addition, for this just occurs to one computer, we can try to use clean boot to re-boot the computer and check if the logoff script can run successfully.
    For detailed information about how to perform a clean boot in Windows, we can refer to the following link:
    How to perform a clean boot in Windows
    http://support.microsoft.com/kb/929135
    Best Regards,
    Erin

  • Lenovo H420 Desktop takes over 5 mins to boot up

    Hi,
    We have a Lenovo H420 desktop that takes over 3 mins to boot up. After you switch it on, the monitor displays a black screen with 'Lenovo' in white writing and remains with this screen for minutes on end seemingly doing nothing (hard drive  cannot be heard working and it's activity light doesn't flash). After about 3 minutes Windows 7 suddenly loads in a matter of seconds.
    Any ideas what is wrong? Is this normal?
    We've only had this computer for about 3 months and it has been doing it since we bought it. We reset the computer back to its factory settings but that hasn't changed anything. Bios doesn't seem to be accessible as no startup screen saying press del for setup etc shows.
    Kaspersky and Malwarebytes doesn't show any nasties.
    Thanks
    Solved!
    Go to Solution.

    Hello and welcome,
    Here's the current version of the manual:  Lenovo H4 Series Hardware Maintenance Manual V1.0
    And the user's guide: Lenovo H4 Series User Guide V3.0
    For future reference, these are available by going to SUPPORT (above ) -> QuickPath (enter model or machine type) -> Guides and Manuals
    Z.
    The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.  The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored. ... GeezBlog
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • What could be wrong with my iMac? When switched on the screen displays the apple logo with a busy bar at the bottom of the screen. This displays the progress of the computer trying to do something. To fill the bar takes about 30 mins and then switches off

    What could be wrong with my iMac? When switched on the screen displays the apple logo with a busy bar at the bottom of the screen. This displays the progress of the computer trying to do something. To fill the bar takes about 30 mins and then switches off

    Which OS X is installed?

  • When I open iTunes it takes like 2 min to let me play music

    I have an external drive with 200GB of music (aiff files mostly), when I open iTunes the cursor becomes in to the multi color spinning disc, it remains like that for 2 min, at the same time external hard drive starts running, in the meantime there is nothing I can do on iTunes. Once the external drive stops the cursor becomes an arrow again and then everything works
    I've been using iTunes like this for many years and I've never had a problem like this, aparently it happens since I updated iTunes to 7.5.
    Does it make sense? it's really annoying to wait 2 min everytime I want to open iTunes, please help!

    Click on your preference and check the Parental tab for possible restrictions.  Open iTunes, then click the iTunes menu, select preferences after the window opens click on the Parental icon, take a look at the content restrictions section.

  • Mail sending problem -- takes forever (30 min+)

    hi,
    i read through some previous topics on this, and tried the "opendns" solution suggested here:
    http://discussions.apple.com/thread.jspa?messageID=9652048&#9652048
    this did not work for me. it's weird, though, in that when i do airport-->advanced-->DNS-->DNS Servers ("add") and try to add the new address/numbers suggested (there are already 2 in there, so i'm trying to add this new one as a 3rd), it won't "accept" them. i click "ok" then "apply" and then when i close and re-open, the newly entered address isn't there.
    **anyway, whether that has anything to do with it or not, i don't know. but sending in Mail is epic. thunderbird is instant, as is web-mail. seems to be a problem here with Mail, not my ISP or email account. i receive email fine, it seems. i saw prev posts lamenting this slow sending, like 30 sec or a minute. mine is taking 30 min or more! just started last night, out of nowhere. on occasion in the past, i've had these random sending delays, though like a few minutes long, not this long (half hour to send! just the spinning "sending" folder thing). no idea why. i do repair permissions frequently, it doesn't help (incidentally, i can do RP back-to-back and i still get a host of things come up that get repaired, though none of which are listed as "Mail" folders...RP takes like 10 minutes, normal?).
    any suggestions?
    thanks,
    kelly

    Hello, and welcome to the Discussions.
    I have experienced the same behavior. For me it is corrected by entering a primary and secondary DNS address in the modem. I think this behavior differs for some people, and must be related to interaction with specific ISPs. One thing to check and report, is to open the Activity window (click on Window in the menubar, and choose Activity) and observe when sending how much time is spent connecting to the SMTP vs transmitting?
    I changed my Modem to have dedicated DNS address. It may be possible to do in the router, instead, but I did mine in the Modem. How that is done will likely depend on the brand of modem. You will likely need to query your ISP to get the server DNS number -- if so, they would be able to guide the change in the modem.
    Ernie

Maybe you are looking for

  • How to read HyperLinks from pdf file??

    hi developer's, I am in PDF processing... I am having doubt in that Processing. How to read Hyperlinks from PDF file? I can able to set the hyperlink.. But i cant able to get the hyperlinks.. The following example program will set the hyperlink to th

  • Quality Inspection with Intervals

    Dear All, We have a requirement where in our client wants that during GRN of bought out material, every alternate GRN should go for Quality Inspection setup. THis frequency can be variable though. How can this be achieved in system. Please note that

  • Open PDF from flash

    I want to open pdf files from buttons, the structure of my project is this: one windows project (exe) called Intro (this is only a presentation) a has one button linked to a .swf file where are the buttons, I know that i can not open pdf files from t

  • Upgrade weblogic version to 10.x

    Hi, I have application developed using JDK1.4.2 and running in weblogic v7.x. If I were to upgrade to weblogic version 10.x, will I have face problem in terms of JDK compatilibility? Anyone has such experience?

  • WF : Event ReleaseStepCreated not triggered BUS2013/2014

    Hi, We have approval WF for PO(BUS2012),SA(BUS2013) and Contracts(BUS2013). We have the following scenario for a PO. 1. When a PO is changed (Value/new line item) when it's approval is still in process and it is Blocked state event CHANGED is fired.