Hibernate all workstations idle for at least 30 minutes, after 10:00pm

Recently i came a across a challenge launched by my boss: Hibernate all workstations idle for at least 30 minutes, after 10:00pm.
By GPO, i can. So, i wrote a script.
I'm using a System.Runtime.InteropServices;
I'm not good in scripts, for this i need help to improve it.
Please, help me. Thank you.

Recently i came a across a challenge launched by my boss: Hibernate all workstations idle for at least 30 minutes, after 10:00pm.
By GPO, i can. So, i wrote a script.
I'm using a System.Runtime.InteropServices;
I'm not good in scripts, for this i need help to improve it.
Please, help me. Thank you.
You ask for help improving a script that you already wrote, but you don't provide said script, nor tell us which part of the script you're having difficulties with... This makes it a bit hard to help you...
Still, I would not suggest going down the route of creating a script for this. Yes it can obviously be done, but there are mechanisms out there that are already more appropriate for handling such things which do not involve re-inventing the wheel: GPO and
Scheduled Tasks are two of them.
If you create it as a *pure* script with no "help" from outside applications, you need to consider these things:
- How do I deploy the script to every machine?
- The script will need to be running in the background the whole time, from the time the computer starts up until it shuts down (it will sit idly doing absolutely nothing until it's past 10:00, but it will be running in the background nonetheless).
- How do you ensure it's running properly?
- Who will support it going forward?
If you use a GPO, you don't have to worry about any of those things (except about how to tell whether it's running properly).
Alternatively, you could also create a scheduled task which kicks off at 10:00 daily with a condition of only start if computer is idle for over 30m where the command that it executes is to hibernate the computer. Scheduled tasks can also be created by GPO,
so you don't have to worry about many of the things you would normally have to worry about if you were using a script.
Again, don't try to re-invent the wheel unless there is some benefit to it. From what you told us about your requirements, there isn't in your particular case.

Similar Messages

  • Emond[106]: Host at 10.0.0.100 will be blocked for at least 15 minutes

    After a clean install of Lion Server 10.7.3 (1.3.1) and making the basic configuration (users etc.) i enabed the Time Machine service with a WDC MyBook Studio Edition II as the destination. Setting up the first client using this TS Service works fine, but the second client reports the error "Time Machine cannot complete the backup, backup disk not available" after starting the initial backup.
    Only indication on the server side that it fails is the message "Feb 25 13:22:48 paris emond[106]: Host at 10.0.0.100 will be blocked for at least 15 minutes" in the system log as an isolated message;
    Feb 25 13:21:50 paris org.clamav.clamd[74]: SelfCheck: Database status OK.
    Feb 25 13:22:48 paris emond[106]: Host at 10.0.0.100 will be blocked for at least 15 minutes
    Feb 25 13:31:50 paris org.clamav.clamd[74]: SelfCheck: Database status OK.
    I tried the following to solve it;
    Flush the firewall
    sudo /sbin/ipfw -f flush
    Change the default firewall address from 127.0.0.0 to the ip-addres of the ethernet interface of the Lion Server
    vi /etc/af.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>blacklist_file</key>
            <string>/var/db/af/blacklist</string>
            <key>default_set</key>
            <string>17</string>
            <key>default_timeout</key>
            <string>15</string>
            <key>firewall_address</key>
            <string>10.20.0.100</string>
            <key>log_facility</key>
            <string>SBS_Security</string>
            <key>log_level</key>
            <string>5</string>
            <key>start_behavior</key>
            <string>enable</string>
            <key>state_file</key>
            <string>/var/run/af_state</string>
            <key>sweep_interval</key>
            <string>20</string>
            <key>whitelist_file</key>
            <string>/var/db/af/whitelist</string>
    </dict>
    </plist>
    serveradmin stop ipfilter
    serveradmin start ipfilter
    Add the subnet 10.x.x.x to the firewall whitelist
    /usr/libexec/afctl afctl -w 10.0.0.0/8
    Till now not, no joy .
    The only indication i could find till now is the "emond[106]: Host at 10.0.0.100 will be blocked for at least 15 minutes" message in the
    system log. Anyone any suggestions , ideas , hints how to analyze this issue further or better to resolve this ?

    I had a similar problem. I fixed it using a few steps. I think the important steps were performed on the Time Machine client although I also rebooted the Time Machine server once and cycled the Time Machine service on and off a few times. I also turned on and off the external drives connected to the Time Machine server.
    Now to the steps that I think actually fixed the problem. They were performed on the Time Machine client.
    1) Under Time Machine in System Preferences, turn it off and remove the remote backup destination.
    2) Under Keychain Access in Utilities within Applications, look for entries under login and System related to your Time Machine server machine.
    3) From the client, I connected to the Time Machine server both through Finder and through Time Machine preferences under System Preferences. Instead of just entering the password, I changed the password a few times.
    4) I also deleted the Keychain entries between some of these password changes.
    5) Then I went back to Time Machine one last time and set up the remote volume on the Time Machine server and turned it on.

  • Every time I try to call or they call me, my phone beugs I can not immediatly to call, denied access the directory for 2 to 4 minutes after that it works again   I tried all but nothing, everything works except the call   I have an iPhone 4 Version 6.1.3

    every time I try to call or they call me, my phone beugs I can not immediatly to call, denied access the directory for 2 to 4 minutes after that it works again
      I tried all but nothing, everything works except the call
      I have an iPhone 4 Version 6.1.3
    thank you for your help

    That is the highest you will be able to go with 3g. You need 3gs or 4 to go any higher (multi processors and more memory needed).  Version 4.2.1 marks the end of your updates for that device.

  • When i start my itunes, it start immediately but than i am not able to click on anything for at-least 20 minutes.

    When i start my itunes, it start immediately but than i am not able to click on anything for at-least 20 minutes.
    I have a lot of songs on there from my local drive and also a network drive which is connected to my local hhome network.
    Now before when i use to load itunes while it get frozen it used to collect information on 3 songs and i knew their names so went ahead and deleted them but now i dont see it collecting any information and just frozen.
    I just got an iphone and also noticed that once i am syncing my iphone and than i cancel the sync it will again freeze.
    What could be causing this, please tell me a way where i dont have to erase my library and re scan it.
    One important note - My iTunes Media folder location is on my Network Drive. Can that be the reason?
    Let me know.
    Thanks in Advance,
    Jay

    The "tap to click" function isn't enabled until a user logs on.  You should be able to use the "physical click" (push down on the front left of the trackpad) in the login screen.
    Regards,
    Captfred

  • My iMac (w/Snow Leaperd) during start-up sits on the white screen with the great wheel spinning for at least 10 minutes... Any fixes?

    When starting the computer just site there for at least 10 minutes sometimes longer.

    Sounds like a good time to make sure you have backups on any critical files.
    Try starting in Safe Mode.  This may fix it or it may push it over the brink.
    Mac OS X: Starting up in Safe Mode - http://support.apple.com/kb/HT1455
    What is Safe Boot, Safe Mode? (Mac OS X) - http://support.apple.com/kb/HT1564
    Safe Boot takes longer than normal startup - http://support.apple.com/kb/TS1884

  • It won't wake up from sleep after I open it. If I close it and then open it, it doesn't wake up for at least 5 minutes.

    just upgrade my macbook air to yosemite. now when i physically close the computer and open it back up, it won't wake up from sleep mode. I tried pressing the power button, but it wouldnt turn on. Then once it somehow turned on by itself, I tried a PRAM and SMC reset. Then I tried closing and opening the computer again and I still had the same problem. nothing has worked. when i do get the computer on, i randomly goes into sleep mode again. I've check the settings for display and it says after 45 minutes of nothing it will sleep.

    Step 1
    Take all the applicable steps in this support article. That's the starting point for any further efforts to solve the problem. Please read the whole article carefully (some of it is hidden by disclosure triangles) and don't skip any of the steps, including the ones under the heading "Additional troubleshooting." If you don't understand any of the steps, ask for guidance.
    Step 2
    If you're running OS X 10.8.5 or earlier, from the menu bar select
               ▹ System Preferences... ▹ Accessibility
    If the checkbox at the bottom marked
              Enable access for assistive devices
    is checked, uncheck it and test.
    If you're running OS X 10.9 or later, select
               ▹ System Preferences... ▹ Security & Privacy ▹ Privacy ▹ Accessibility
    If any applications are listed on the right and have a checked box next to them, uncheck all the boxes and test. You may first have to click the padlock icon in the lower left corner of the window and authenticate as an administrator to unlock the settings.
    Step 3
    In the Energy Saver pane of System Preferences, uncheck the box marked
              Put hard disks to sleep when possible
    Step 4
    This and the next step must be taken as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ System Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. If you don't see that heading, select
              View ▹ Show Log List
    from the menu bar.
    There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You may see one or more reports with a name that begins with "Sleep Wake Failure" followed by a date. Select the most recent one. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    Step 5
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ Diagnostic and Usage Messages
    In the search box in the window's toolbar, enter "powerd" (without the quotes.)
    You may see one or more lines like this:
    com.apple.message.signature: Platform Failure
    If you do see that, and you did everything in the preceeding steps, then you're dealing with an internal hardware fault. Make a "Genius" appointment at an Apple Store, or go to another authorized service provider.

  • ITunes stays busy for up to five minutes after starting

    Okay, Windows 7 Pro, iTunes 10.3.1.55.  iPod Touch available via wireless.  Nothing from Apple is in my startup list.
    When I start my computer, iTunes may or may not start up automatically.  When it does start up, most of the time it displays a busy mouse arrow for up to five minutes.  I can do nothing with iTunes until it finishes its "routine".  I can't even terminate it except with Task Manager.
    I've gone through the options and tried to turn off anything that would cause this, such as synching with the iPod.  I keep hoping with each new release that Apple will solve my problem so I can use iTunes when it starts up.
    Help!  This is really annoying!
    Gerry

    That is [https://bugzilla.mozilla.org/show_bug.cgi?id=595530 Bug 595530] – Searching bookmarks and history is much slower after SQLite 3.7.x upgrade
    ''(please do not comment in bug reports)''

  • My Mac is travelling extremely slow. Applications bounce for at least a minute before opening (if they open at all). Any time i click the mouse or start typing i intantly get the colour wheel. Help!!!

    My Mac Daddy is running extremely super slow. It has been gradually getting slower over the last week or so but now it is ridiculous. Not just safari. Apps bounce for about a minute before opening (if they open at all) have had a "Application not responding" message when i right click on the icon. Every single time i click the mouse or begin to type i get the colour wheel. I have Mac Keeper and have runs scans, all okay and now mac keeper wont open at all. It even takes a couple of minutes to quit apps and even to shut down. HELP!!!

    To build on you main question, i would take a look at this:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility.  For situations DU cannot handle the best third-party utilities are: Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation.  TechTool Pro 4.5.1 or higher are Intel Mac compatible;  Drive Genius is similar to TechTool Pro in terms of the various repair services provided.  Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.  These utilities have limited or no functionality with Snow Leopard and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.  Other utilities are also available such as Onyx, Leopard Cache Cleaner, CockTail, and Xupport, for example.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.
    If you still are not happy with performance then consider reinstalling Snow Leopard:
    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.

  • IPod has been syncing for at least 30 minutes... iTunes won't open...

    Sorry... I just figured it out. I had to go into Computer then eject it from there then just plug it in again. Sorry
    Message was edited by: bobertoq

    Photos
    - If they are in an iPod backup then restore another iPod, iPhne or iPad from that backup. See the restore topic of:
    iOS: How to back up
    - Maybe from the restored iPod via
    How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html
    iPod recovery software to restore lost music files      
    -iPod touch Deleted Photo Recovery Tips You Should Know
    To restore the iPod:
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    You can also contact a Data Recovery Company

  • ITunes refuses to open for at least 5 minutes.

    Okay so the other day i started having frustrating problems with my iTunes. I've had this computer for around 3 months now and there hasn't been a single problem related to iTunes, i double click the launch icon on the desktop and it opens within seconds. Which is what is supposed to happen...
    Then suddenly it started being slow, i'd double click it, the rotating 'loading circle' would pop up for a brief amount of time and then stop, iTunes wouldn't open but the processes would show as being active. I did everything in the book to try and sort it out, tried a different user account, used the system restore function, re-installed iTunes, QuickTime, even Bonjour... still with no luck. Having an iPhone 3GS i require iTunes to transfer music and the like and it's become frustrating that i'm unable to do anything iTunes related with it. I decided to do a complete format which wiped everything from my computer - it's basically a new computer... which in turn means i've lost everything, my music, videos and pictures... which i'm not overly bothered about as they're replaceable with time.
    I configured my 'new' computer, downloaded iTunes and YET AGAIN, the same thing happend. I then tried downloading an earlier version once again (9.2.1) and installed it, same problem. Completely baffled as to what the problem is as technically it's a brand new machine and should therefore have no problems with opening iTunes, and i know it's not just the program or my computers speed due to it working flawlessly previously.
    Any helps appreciated, this is seriously annoying me now.

    Okay so the other day i started having frustrating problems with my iTunes. I've had this computer for around 3 months now and there hasn't been a single problem related to iTunes, i double click the launch icon on the desktop and it opens within seconds. Which is what is supposed to happen...
    Then suddenly it started being slow, i'd double click it, the rotating 'loading circle' would pop up for a brief amount of time and then stop, iTunes wouldn't open but the processes would show as being active. I did everything in the book to try and sort it out, tried a different user account, used the system restore function, re-installed iTunes, QuickTime, even Bonjour... still with no luck. Having an iPhone 3GS i require iTunes to transfer music and the like and it's become frustrating that i'm unable to do anything iTunes related with it. I decided to do a complete format which wiped everything from my computer - it's basically a new computer... which in turn means i've lost everything, my music, videos and pictures... which i'm not overly bothered about as they're replaceable with time.
    I configured my 'new' computer, downloaded iTunes and YET AGAIN, the same thing happend. I then tried downloading an earlier version once again (9.2.1) and installed it, same problem. Completely baffled as to what the problem is as technically it's a brand new machine and should therefore have no problems with opening iTunes, and i know it's not just the program or my computers speed due to it working flawlessly previously.
    Any helps appreciated, this is seriously annoying me now.

  • I can open Facebook or Yahoo mail, but when I click to do something else the first time Firefox hangs up for at least 5 minutes.

    I just went to Internet Explorer (which I am doing this on) and opened up Facebook and didn't have any problems, so I assume Firefox is the problem. However, I usually cut Firefox off when I get out because it also seems like it too often stays up after I get out of it.

    Troubleshooting extensions and themes
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Clear Cookies & Cache
    * https://support.mozilla.com/en-US/kb/Template:clearCookiesCache
    Clear the Network Cache
    * https://support.mozilla.com/en-US/kb/How%20to%20clear%20the%20cache#w_clear-the-cache
    Problems using Facebook in Firefox
    * https://support.mozilla.com/en-US/kb/Problems%20using%20Facebook%20in%20Firefox
    Check and tell if its working.

  • I'm trying to update FIFA 13 via iTunes, so I clicked "update" and then "sync". It shows a load bar under FIFA, but it hasn't made progress for at least 30 minutes. Ideas/suggestions please!

    It gives me the option to delete FIFA, but I would like to avoid this, in fear of losing my saved compitions and Ultimate Team.

    When I try to snyc my iTouch after updating, it says that there was an error, and I can't update it from my iPod because it already is, but it's stuck or something. Still hasn't made any progress.

  • Firefox 4 and 5 open quickly on my mac with snow lepard but then does not respond for at least 1 minute? after that it runs great. I have tried opening in safe mode and also turned of automatic updates. Same results.

    I recently installed Adobe CS 5.5 suite

    Hi,
    /Users/sarahschadek/Desktop/Safari.app/Contents/MacOS/Safari
    Move the Safari app from the Desktop to the Applications folder.
    Restart your Mac.
    That's why you see this:
    When I try to do the updates my computer says it has ready it goes through like it is downloading them then at the end it says some of the files could not be saved to "/" files.
    After your restart your Mac, click the Apple  menu (top left in your screen) then click:  Software Update ...
    Carolyn  

  • Internet hangs/drops after leaving it idle for a few minutes.

    Quick question that I've been pulling my hair out over... I have had a MBP for about 6 months now which I have been connecting to the internet via wireless router (Linksys WRT150N). I'm currently using OS X 10.4.11. For the most part, internet is lightning fast, but every half hour or so (or when I let the Mac sit idle for a couple of minutes, noting that I keep my sleep mode at 'never'), it hangs, saying that it can't find the server. Airport says I got a full signal, and tests say that everything is working properly, but Firefox and Safari are lights out. The way to get it back can be one of the following:
    1) Wait... sometimes comes back on if I wait a few more minutes (a pain in the rear!!)
    2) Re-boot... this does not work 100% of the time (also a pain in the rear!!).
    3) Plug my charger in and open Airport connection, which sometimes picks up the page loading (again, a pain in the rear).
    Anyway, I've been reading about some issues with both Tiger and Leopard's internet connectivity issues. One posting here (can't find it now) gave me some suggestions on changing the settings in my router settings page, which helped significantly, but I still have intermittent hangs.
    Any help would be totally appreciated (and sorry this is so long!).

    Not an infrequent problem on/for IntelBooks it seems, especially moreso running on Battery power.
    Some cures I've seen, no single one seems to work for everyone, and not all get cured...
    Changing the Channel on the Wireless Router.
    The following commands from the command line, (lasts until a reboot)...
    sudo sysctl -w net.inet.tcp.delayed_ack=0
    sudo sysctl -w net.inet.tcp.mssdflt=1492
    sudo sysctl -w net.inet.tcp.newreno=1
    sudo sysctl -w net.net.inet.tcp.always_keepalive=1
    The last cure I read about was a Cordless Phone being moved.
    The strangest cures, (2 or 3), was connecting once to a Wifi Cafe's hot spot, then never seeing the issue at home thereafter!?

  • HT1212 I'm trying to restore my iPhone but it's saying it's disabled for 22,000,000 minutes!

    I lost my iphone 4 about 2 months ago and the battery died before I could use Find My iphone. I thought I lost it competely so I got a new phone, and iphone 5 this time. After another three weeks of buying the new phone I found my old one just in a bookbag I forgot I'd used. I thought it would be cool now to use the old phone as just an ipod but when I turned it on (after a good charge) all it displayed was the word iphone and the apple logo. It wouldn't even let me put my passcode in. I took it to Best Buy today to find out what was wrong with it, but they didn't even know. They had to restart it twice and it finally came up with the red disabled warning. It says, "try again in 22,744,982 minutes. Ummmm, I'll be about 80 years old when I can log back into my iphone. Best Buy told me just to reset it on iTunes. But here I am and iTunes wants me to put in my security passcode in order to access my phone, which brings me back to the same warning.....This is a vicious loop, a Catch 22, and I don't know what to do now. Any ideas?? Thanks in advance.

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device
    1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    2. iOS- Forgotten passcode or device disabled after entering wrong passcode
    3. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    4. iOS- Understanding passcodes
    5. What to Do If You've Forgotten Your iPhone's Passcode
    6. How to Recover Forgotten iPhone Restrictions Passcode | The iPhone and iPad
    7. Restoring iPod touch after forgotten passcode
    8. RecBoot: Easy Way to Put iPhone into Recovery Mode - if all else fails.
    Forgotten Restrictions Passcode Help
    1. How to Recover Forgotten iPhone, iPad Restrictions Passcode
        If this method does not work, then you will need to fully Restore your
        device as New
    Also, see iTunes- Restoring iOS software.
    And, if this fails:
    Placing your device into recovery (DFU) mode:
    Follow these steps to place your iOS device into recovery mode. If your iOS device is already in recovery mode, you can proceed immediately to step 6.
       1. Disconnect the USB cable from the iPhone, iPad, or iPod touch, but leave the
           other end of the cable connected to your computer's USB port.
       2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds
           until the red slider appears, then slide the slider. Wait for the device to turn off.
                  * If you cannot turn off the device using the slider, press and hold the
                    Sleep/Wake and Home buttons at the same time. When the device turns off,
                    release the Sleep/Wake and Home buttons.
      3. While pressing and holding the Home button, reconnect the USB cable to the
           device. The device should turn on. Note: If you see the battery charge warning,
           let the device charge for at least ten minutes to ensure that the battery has some
           charge, and then start with step 2 again.
      4. Continue holding the Home button until you see the "Connect to iTunes" screen.
           When this screen appears you can release the Home button:
      5. If necessary, open iTunes. You should see the following "recovery mode" alert:
      6. Use iTunes to restore the device.
    If you don't see the "Connect to iTunes" screen, try these steps again. If you see the "Connect to iTunes" screen but the device does not appear in iTunes, see this article and its related links.
    Additional Information:
    If you have a problem getting into recovery mode then try: RecBoot: Easy Way to Put iPhone into Recovery Mode.
    Note: When using recovery mode, you can only restore the device. All user content on the device will be erased, but if you had previously synced with iTunes on this computer, you can restore from a previous backup. See this article for more information.

Maybe you are looking for