A powershell script to export then delete exported items every month .

Hi all ..
We have an exchange 2013 server running on windows 2012 server .
I have a mailbox "MB1" hosted on a database with some other mailboxes .
I want to build a powershell script to export MB1 to a .PST file every month to a shared folder with the name of the month automatically , for example , \\fileserver\share1\November.pst
after export to PST , delete all messaged in MB1 , to be empty and ready for the next month .
please, if you have a script for this or KB or guide ... please reply me
Thanks alot .

The script you are asking is not available handy. It must be something that has to be written. Start Developing a a script and ping back for any assistance. To help you start of with your script you can include this.
1. New-MailboxExportRequest -Mailbox MailboxName -FilePath \\MBX-01\PSTFileShare\MailboxName.pst2. Next Step is to check if the ExportRequest was completed. You can use If Condition to check the same.If((Get-MailboxExportRequestStatistics "MailboxName").Status -eq "Completed"){Search-Mailbox MailboxName -DeleteContent -Force}Once you get hold of the logic, you can schedule to run the script once in a month using Task Scheduler.
M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This
Information is provided is "AS IS" and confers NO Rights!!

Similar Messages

  • PowerShell script to find and remove duplicate items from document library

    Hi Friends,
    Please check this below script, It is finding the duplicate items and removing it. This script is not working to find the duplicate items from document
    library and remove. Can you please let me know where it is wrong.
    Add-PSSnapin microsoft.sharepoint.powershell 
    $web = Get-SPWeb -Identity "http://zapltvsspdev02:4333/bu/EXCO" 
    $list = $web.Lists["AECI Documents"] 
    $AllDuplicates = $list.Items.GetDataTable() | Group-Object INumber | where {$_.count -gt 1} 
    $count = 1 
    $max = $AllDuplicates.Count 
    foreach($duplicate in $AllDuplicates) 
    $duplicate.group | Select-Object -Skip 1 | % {$list.GetItemById($_.ID).Delete()} 
    Write-Progress -PercentComplete ($count / $max * 100) -Activity "$count duplicates removed" -Status "In Progress" 
    $count++ 
    Remove-PsSnapin Microsoft.SharePoint.PowerShell
    Note:
    In the above code, duplicates are found using the "INumber" column. 
    valmiki

    check this
    http://stackoverflow.com/questions/21337158/delete-duplicate-items-in-sharepoint-list

  • Simple powershell to get list then excute each item of list HELP :)

    ok i think this is pretty simple i just don't know the language. if i run
    get-scdwjob -computername MYSERVERNAME
    i get a nice list of all the jobs, i need to run an enable-scdwjob on each one of those jobs.
    i tried figureing out how to do this but nothing is working

    Hi Philipzempel,
    I’m writing to just check in to see if the suggestions were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Powershell script for deleting sitecollection and its content db

     want to know whether any powershell script is avlble for deleting the sitecollection and its content db at oneshot!
    i have created sitecollection specific content db and i wanna delete the same.

    Hi,
    Below link will help to delete site collection
    http://technet.microsoft.com/en-us/library/cc262392(v=office.15).aspx
    Thanks
    Somnath Matere

  • Powershell Script to create "custom" Document Library

    I have a powershell script which creates a Document Library for every user in AD.
    This works, but rather than using the default Document Library I want it use a custom Document Library.  However this isnt working.
    My script to create the default Document Library is this...
    [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
    $site = new-object Microsoft.SharePoint.SPSite("http://servername/sitename");
    $siteweb = $site.OpenWeb();
    $webs = $siteweb.Webs;
    $strFilter = "(&(objectCategory=User)(name=accountname))"
    $objDomain = New-Object System.DirectoryServices.DirectoryEntry
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = $objDomain
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = $strFilter
    $objSearcher.SearchScope = "Subtree"
    $colProplist = "samaccountname"
    foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
    $colResults = $objSearcher.FindAll()
    foreach ($objResult in $colResults)
    $objItem = $objResult.Properties; $objItem.samaccountname
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
    $listId = $siteweb.Lists.Add($objItem.samaccountname, "", $listtemplate);
    $list = $siteweb.Lists.GetList($listId, $true);
    $roleDef = $siteweb.RoleDefinitions.GetByType("Contributor");
    $user = "domain\" + $objItem.samaccountname;
    $rolAssign = new-object Microsoft.SharePoint.SPRoleAssignment($user, "email", "name", "notes");
    $rolAssign.RoleDefinitionBindings.Add($roleDef);
    if(!$list.HasUniqueRoleAssignments)
    {$list.BreakRoleInheritance($true);}
    for ($i = $list.roleAssignments.Count - 1; $i -gt -1; $i--)
    { $list.RoleAssignments.Remove($i) }
    $list.RoleAssignments.Add($rolAssign);
    $list.Update();
    Now I have a custom Document Library named "TESTLIB" so if I substitute the line:
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
    with
    $listTemplate = [Microsoft.SharePoint.SPListTemplateType]::TESTLIB
    Then it errors with this...
    How can I script powershell to create a "custom" Document Library?
    Thanks

    The below link should help you in creating custom document library using powershell
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/23/use-powershell-cmdlets-to-manage-sharepoint-document-libraries.aspx
    Vinod H
    Thanks for the link but I cant see anything to assist creating a custom library?  Was there something in paticular you saw?

  • Script to delete users profile only months old profile with the Registry itself but should leave current profile intact.

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

  • Within Playlist: Way to delete an item from the Library directly?

    Viewing items in Playlist: Is there a way to delete an item (expunge from disk) from the Library directly?
    Right now, if I want to delete a voice memo, I have to go to the Music tab and sort by genre and then delete the item; What A Hassle!

    good question-answer.
    http://psychology.clas.asu.edu/files/u48/images/9/map.html
    http://psychology.clas.asu.edu/files/u48/images/10/map.html
    http://raiuniversity.edu/my/img/5/map.html
    http://raiuniversity.edu/my/img/6/map.html
    http://mse.rutgers.edu/css/rks/1/map.html
    http://mse.rutgers.edu/css/rks/2/map.html
    http://psychology.clas.asu.edu/files/u48/images/9/index.html
    http://psychology.clas.asu.edu/files/u48/images/10/index.html
    http://raiuniversity.edu/my/img/5/index.html
    http://raiuniversity.edu/my/img/6/index.html
    http://mse.rutgers.edu/css/rks/1/index.html
    http://mse.rutgers.edu/css/rks/2/index.html

  • How to export Powershell script information to Sharepoint?

    I'm trying to export information gather from a Powershell script to a Sharepoint list. I've got a couple of powershell scripts that gather general server information from a server ex: server uptime, disk space, service tag, etc. and it will export the information
    to a csv file. What I would like to do is out-put the same information gathered by the powershell scripts to a Sharepoint list directly if at all possible.
    Ex:
    # all this does is reads from a list and runs a script call "boottime.ps1"
    get-content "\\%Data-Path-Of-List%\computers.txt" | %Data-Path-Of-Script%\boottime.ps1 |  Export-csv %Data-Path-For-CSV\Computers.csv
    # then just exports the information from the boottime.ps1 script to a csv file
    #I also have a script that will upload the information to a sharepoint list.
    # I found that I have to run this in version 2 of powershell, so I just open a DOS prompt in Admin Priv's and type the following
    powershell.exe -version 2.0
    # Next I make sure the Sharepoint snap-in is loaded
    if ( (Get-PSSnapin -Name Microsoft.sharepoint.powershell - erroraction silentlycontinue) -eq $null)
    Add-PsSnapin Microsoft.Sharepoint.Powershell
    $spweb = get-SPweb $spserver
    $spdata =$spweb.getlist("%URL_Of_My_List%")
    # this is the same location from the orginal Powershell script previously stated.
    $ComputerInfoFile = "%Data-Path-For-CSV%\Computers.csv"
    foreach ($rows in $tblData) {
    # here is where I add the information from my csv file
    # 2 things needs to be present
    # 1st the colums have to be present in the sharepoint site before I can upload the information
    # 2nd the columns have to the headers in my csv file
    $spItem = $spData.AddItem()
    $SpItem["ServerName"] = $row."ServerName".toString()
    $SpItem["Uptime"] = $row."Uptime".toString()
    $SpItem.Update()
    # this just disconnects from Sharepoint
    $spWeb.Dispose()
    Please dismiss all the comments it just helps me understand what the code is doing, also if this is not the correct place to post this question I appologize in adavance and ask that if this is the incorrect place to post this question please provide me a
    link to a where I can post such questions.

    Sorry for the delay in posting this, but I ended up getting working. I'll post it in the hopes that my head scratching will save someone else some head scratching:
    I ended up writting 3 PS scripts and one batch job.
    1st Batch file
    powershell.exe -version 2.0 -command
    \\%Script-Location\Get-Server-Infor-4-SP.ps1
    powershell.exe -version 2.0 -command \\%Script-Location\Delete-list-Items.ps1"
    powershell -veriosn 2.0 -command
    \\%Script-Location\Populate-SP.ps1
    1st PS script that gets the info:
    get-content
    \\%Location-Of-My-File-With-List-Of-Servers%\%name-of-file%.txt |
    \\%Location-Of-My-Script-To-get-the-Information-I-want | Export-csv
    \\%location-of-my-output\%filename%.csv
    Ex: get-content C:\scripts\computers.txt | C:\scripts\boottime.ps1 | export-csv C:\scripts\computer.csv
    2nd PS script Delete-List-Items.ps1
    # http:
    #Script 1 Boottime.ps1:
    # This script permits to get UpTime from localHost or a set of remote Computer
    # usage
    # localHost
    # .\BootTime.ps1
    # set of remote computers
    # get-content .\MyserverList.txt | .\boottime.ps1
    # Optionally pipe output to Export-Csv, ConverTo-Html
    Process {
    $ServerName = $_
    if ($serverName -eq $Null) {
    $serverName= $env:COMPUTERNAME
    $timeVal = (Get-WmiObject -ComputerName $ServerName -Query "SELECT LastBootUpTime FROM Win32_OperatingSystem").LastBootUpTime
    #$timeVal
    $DbPoint = [char]58
    $Years = $timeVal.substring(0,4)
    $Months = $timeVal.substring(4,2)
    $Days = $timeVal.substring(6,2)
    $Hours = $timeVal.substring(8,2)
    $Mins = $timeVal.substring(10,2)
    $Secondes = $timeVal.substring(12,2)
    $dayDiff = New-TimeSpan $(Get-Date –month $Months -day $Days -year $Years -hour $Hours -minute $Mins -Second $Secondes) $(Get-Date)
    $Info = "" | select ServerName, Uptime
    $Info.servername = $servername
    $d =$dayDiff.days
    $h =$dayDiff.hours
    $m =$dayDiff.Minutes
    $s = $daydiff.Seconds
    $info.Uptime = "$d Days $h Hours $m Min $s Sec"
    $Info
    #Script 2: Delete-List-Items.ps1
    # http://markimarta.com/sharepoint/delete-all-items-in-sharepoint-list-using-powershell/
    # there seems to be a problem with running this script in version 3 or later, the workaround is to run it in version 2
    # below is the cmd for doing so, just open up a DOS prompt with Admin Privileges Start-->Run-->cmd
    # type then copy and paste the following line the DOS window then you can run this script
    #powershell.exe -version 2.0
    # make sure that the Microsoft.SharePoint.PowerShell Snap-in is installed as well
    if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
    Add-PsSnapin Microsoft.SharePoint.PowerShell
    # "Enter the site URL instead http://serverurl"
    $SITEURL = "%http://serverurl%"
    $site = new-object Microsoft.SharePoint.SPSite ( $SITEURL )
    $web = $site.OpenWeb()
    "Web is : " + $web.Title
    # Enter name of the List below in the [“%List-Name%”]
    $oList = $web.Lists["%List-Name%"];
    # This echo out the name of the list its going to be deleting the records from
    "List is :" + $oList.Title + " with item count " + $oList.ItemCount
    # It’s just counting the rows/records
    $collListItems = $oList.Items;
    $count = $collListItems.Count - 1
    # Here is where it is actually deleting the records and then out put the number or the record it deleted
    for($intIndex = $count; $intIndex -gt -1; $intIndex--)
    "Deleting record: " + $intIndex
    $collListItems.Delete($intIndex);
    #Script 3: Populate-SP_Test.ps1
    # http://blogs.technet.com/b/stuffstevesays/archive/2013/07/10/3577320.aspx
    # there seems to be a problem with running this script in version 3 or later, the workaround is to run it in veriosn 2
    # below is the cmd for doing so, just open up a DOS prompt with Admin Privileges Start-->Run-->cmd
    # type then copy and paste the following line the the DOS window then you can run this script
    #powershell.exe -version 2.0
    # make sure that the Microsoft.SharePoint.PowerShell Snap-in is installed
    if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
    Add-PsSnapin Microsoft.SharePoint.PowerShell
    # Here are some more varables that can be added I was not able to get this to work
    #$SPComputerInfo="/Lists/PowershellTest/"
    # Here is where we connect and Open SharePoint List via Powershell
    $SPServer= "%http://serverurl%
    $spWeb = Get-SPWeb $SPServer
    $spData = $spWeb.GetList("%List-Name%")
    # This is the variable for the path that has the file I want to input to SharePoint List
    $InvFile="\\%location-ofList%\computers.csv"
    # This is just some error checking to make sure the file exist
    $FileExists = (Test-Path $InvFile -PathType Leaf)
    if ($FileExists) {
    "Loading $InvFile for processing..."
    $tblData = import-csv $InvFile
    } else {
    "$InvFile not found - stopping import!"
    exit
    # Loop through Applications add each one to SharePoint
    "Uploading data to SharePoint...."
    foreach ($row in $tblData) {
    #Here is where I add the information from my CSV file
    #2 things have to be present
    # 1. the columns have to be in the sharepoint site before I can import the information
    # 2. columns have to the headers in my csv file
    #"Adding entry for "+$row."Computer Information".ToString()
    $spItem = $spData.AddItem()
    $spItem["ServerName"] = $row."ServerName".ToString()
    $spItem["Uptime"] = $row."Uptime".ToString()
    #$spItem["DNSHostName"] = $row."DNSHostName".ToString()
    #$spItem["DistinguishedName"] = $row."DistinguishedName".ToString()
    $spItem.Update()
    # This is just disconnecting from SharePoint
    $spWeb.Dispose()
    Enjoy, and if anyone has a better way of doing this I'm interested in knowing, thanks again
    Thanks in Adavance

  • Using Powershell Script Run simple query in MS Access 2007 and export the results of query to Excel

    Hi Experts,
    I have a Access 2007 DB file and 2 Big tables inside that (bigger than the size that can be easily handled by MS Excel 2007).
    My requirement is automate using powershell scripts the below things.
    1. Create a SQL query in Access DB and save that in access DB
    2. Run the saved query and export the result in excel sheet where I can create the charts and Pivots. Thanks in advance
    Prajesh

    Do you have to use the Access query, couldn't you just recreate the query in Powershell?  Here's a link with good info that references an existing script for querying an Access database:
    http://blogs.technet.com/b/heyscriptingguy/archive/2009/08/13/hey-scripting-guy-can-i-query-a-microsoft-access-database-with-a-windows-powershell-script.aspx
    Once you have your dataset you can pipe it to
    Export-Csv -NoType c:\pathtofile\output.csv

  • HT4236 I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto. I want to sync both from my ext drive and new albums in iPhoto. No dice. Help!

    I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto. I want to sync both from my ext drive and new albums in iPhoto. My photos on the devices get wiped out when I sync to iPhoto since I deleted all the albums. But when I sync to my hard drive (where I maintained the album structure) the photos are copied to my iPad but lose all the hierarchy and folder structure. Now I have to scroll through thousands of photos to try to find the one I'm looking for. Before I sync any more devices I want to know the following: 1) can I restore the album structure on my iPad by using the photo cache? 2) is there a way to sync both new iPhoto albums AND pictures in the folders in my hard drive? And 3) how can I keep the photo hierarchy structure from my hard drive intact on my devices?

    TigerMom28 wrote:
    I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto.
    Don't do that.
    Copy /Photos/Photo library/ to the external.
    Hold Option and launch iPhoto.
    Select Choose library and select the Photo library you copied to the external.

  • I created an iMovie using pictures from my camera roll, I exported the movie to the camera roll and then deleted all of the pictures. Now I can't get the movie to play. Did deleting the pictures cause my IMovie to disappear? How can I get my movie back?

    I created an iMovie using pictures from my camera roll, I exported the movie to the camera roll and then deleted all of the pictures. Now I can't get the movie to play. Did deleting the pictures cause my IMovie to disappear? How can I get my movie back?

    Download and open this program, lets you look around your I phone as if it was a disc drive, might find em in the iphones drive.
    http://www.macroplant.com/iexplorer/

  • Export photos to storage then delete from macbook

    My Macbook is messaging "Disk nearly full" 50% is photos. How do I export them to free free up space, then delete them from the Mac but keep them externally for future viewing?
    Thanks in advance for any help.
    Ian

    Read this discussion with posts by the best iPhoto ASC participants:
    https://discussions.apple.com/thread/5514916?tstart=0
    Ciao.

  • Script or way to delete or export random pages from pdf...

    hello
    I have many request to export random pages from pdf doc. etc.. 1-3,51,63,78-92...I think that easy way is to have some script which will open dialog box and ask for which pages I want to export or delete from pdf. Anyone have something for this?
    thanks

    I find way for this on adobe blog. I am so stupid that I miss this "choose pages" button!!! You can combine more files and in list select pdf, and choose which pages from individual doc you want. Great
    http://blogs.adobe.com/educationleaders/2008/05/extracting_non_sequential_page.html

  • I want to export to Flickr as backup and then delete originals

    This is puzzling me.
    I'm hoping to backup a bunch of my photos to Flickr, then delete them from Aperture. But after I have exported my photos to Flickr and I try to delete the originals, I get a message asking me if I'm sure I want to move the selected photos to the trash. It further warns me that the versions will be "removed from all Albums, Books... Flickr Albums..." etc.
    What is the best process for doing what I am trying to do? This seems very counterintuitive. Thanks.

    Hi Michael,
    Imho, what you're proposing is an elegant but flawed solution.  Backing up (or archiving) data must be 100% reliable, and, using the common methods, isn't expensive.  Using Flickr to do two tasks (publish your work on-line, and serve as a back-up copy) is clever, but Flickr is not, in my judgement, 100% reliable.  The gain simply isn't worth the cost -- especially since you already have an excellent back-up system (Time Machine + Aperture Library Vaults).
    One of the truism I rely on when decided what to keep and what to toss is, "If it's good enough to show to people, it's worth keeping."  Certainly one should retain much more than a _minimum_ amount.  The second truism I rely on is, "If it's worth keeping, it's worth keeping the entire Image-production-module of the RAW (or camera-made) file and the instructions I labored to create that produce the picture I want from that file."  So my advice is to keep, in Aperture, any Image that is worth putting on Flickr.
    The Image is made from two files: the Original, and the Version.  The Version is a text file that is always stored in the Aperture Library package.  The Original is simply the image-format file you imported.  Aperture -- brilliantly -- allows you to store you Originals on any, and as many, directly-attached storage devices as you want, and furthermore allows you to move them whenever you want.
    The issue you are dealing with (afaict) is how to _archive_ Images that have been fully developed.  My first question is: why archive them at all?  If your Library is too large, move older Images' Originals to a dedicated external storage device.  If your dedicated external storage device is not big enough, purchase another (data storage is one of the greatest bargains of our time).  If you've moved almost all of your Originals to a dedicated external storage device, and your Library is still too large, move the entire Library to a dedicated, fast, external storage device (today, use USB-3 or Thunderbolt).  If the problem you are trying to solve is one of organization rather than storage, then you'll have to look at your workflow and make improvements.  One of the simplest things to do in your Library is to create a new Folder (call it "Archive" or whatever) and move Projects that contain Images with which you are finished into it.  Use the disclosure triangle to collapse the Folder.  Out of sight, out of mind -- but safely archived and doesn't require any additional effort to be backed up.  If that doesn't fit your workflow, then we need to know more about your workflow in order to suggest improvements.
    If you have a set of Images that make up a fully self-contained set and you really want them out of your Library (e.g.: scans for a completed project), export them into their own Library, put that Library with your general documents, and delete the Images from your main Library.
    A general (and slightly out-of-date) post about the workflow I use and recommend, is here.
    HTH,
    --Kirby.

  • Looks great in viewer & fully rendered.  Then = Crazy Export!  ***???

    Ok, so I have this great video and I've fully rendered it and played it back in the viewer and everything is great.
    I export it via compressor as a quicktime movie.
    PROBLEM: In the QT edition some things aren't "working" - like there is a clip i had cropped which is no longer cropped and text is slightly moved. Is this random?? Did i do something wrong?? Help!!!

    Check if you're export setting matches your sequence setting.
    Then delete all the render of the sequence via the "render manager tool", because they might be some corrupted media.
    Try to re-export after that.

Maybe you are looking for

  • Programmatically starting a cluster?

    All, I've been using Coherence for many years and am now experimenting with Extend in the new 12.1.3 release.  I'm trying to run my storage nodes as a simple webapp in Tomcat.  My idea for starting to cache node was to use a ServletContextListener. 

  • Create VI Reference from VI Reference

    Given a VI reference that is valid, is there an easier way to create a new VI reference, other than by using a property node, pulling the VI name, and using Open VI reference? I've never needed to do this before but I assumed there would be some invo

  • Problem after installing firmware 1.4... please help!

    Hi all, i recently upgraded to firmware 1.4 (the recent available version)... and now, every few minutes the fan generates big noises (also generating heats around the speaker area)... i looked into the Activity Monitor and i found that there are som

  • Sound card driver installation issue on Satellite A30

    Ok basically I don't have any sound on the laptop and realised that there isnt a driver installed so I went onto the Toshiba website and downloaded the correct one. The problem however is that the driver wont install properly it comes up with a windo

  • Unable to install Windows 8 over network

    Hi, I ll make my story short. I accidentally deleted some registry keys which rendered my keyboard and mouse unusable in windows 8. I tried to repair it via netwrok as I dont have a dvd or usb drive. I configured the tftp server using "serva" insted