{"id":85,"date":"2011-09-26T11:50:00","date_gmt":"2011-09-26T11:50:00","guid":{"rendered":"\/post\/2011\/09\/26\/Test-network-with-filecopy-and-Powershell.aspx"},"modified":"2011-09-26T11:50:00","modified_gmt":"2011-09-26T11:50:00","slug":"test-network-with-filecopy-and-powershell","status":"publish","type":"post","link":"https:\/\/www.vatland.no\/index.php\/test-network-with-filecopy-and-powershell\/","title":{"rendered":"Test network with filecopy and Powershell"},"content":{"rendered":"<p>Needed a way to test and time filecopy between servers using powershell. This is what I came up with. This example will use copy testfile.zip to server and time the progress. I used a file of 1.8 Gb.<\/p>\n<p>$servers=&#8221;server1&#8243;,&#8221;server2&#8243;,&#8221;server3&#8243;,&#8221;server4&#8243;,&#8221;server5&#8243;,&#8221;server6&#8243;<br \/>foreach($server in $Servers){<br \/>if (!(test-path <a href=\"file:\/\/\\\\$server\\share\\temp\">\\\\$server\\share\\temp<\/a>)) {<br \/>&nbsp;&nbsp;&nbsp; new-item -path <a href=\"file:\/\/\\\\$server\\share\">\\\\$server\\share<\/a> -name temp -ItemType Directory<br \/>}<br \/>$start = get-date<br \/>copy-item C:\\temp\\testfile.zip -Destination <a href=\"file:\/\/\\\\$server\\share\\temp\\testfile.zip\">\\\\$server\\share\\temp\\testfile.zip<\/a><br \/>$end = get-date<br \/>Remove-Item <a href=\"file:\/\/\\\\$server\\share\\temp\\testfile.zip\">\\\\$server\\share\\temp\\testfile.zip<\/a><br \/>[TimeSpan]$Totaltid = new-timespan $start $end <br \/>write-host $($server) &#8211; $($Totaltid.seconds)s<br \/>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Needed a way to test and time filecopy between servers using powershell. This is what I came up with. This example will use copy testfile.zip to server and time the progress. I used a file of 1.8 Gb. $servers=&#8221;server1&#8243;,&#8221;server2&#8243;,&#8221;server3&#8243;,&#8221;server4&#8243;,&#8221;server5&#8243;,&#8221;server6&#8243;foreach($server in $Servers){if (!(test-path \\\\$server\\share\\temp)) {&nbsp;&nbsp;&nbsp; new-item -path \\\\$server\\share -name temp -ItemType Directory}$start = get-datecopy-item C:\\temp\\testfile.zip -Destination &hellip; <a href=\"https:\/\/www.vatland.no\/index.php\/test-network-with-filecopy-and-powershell\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Test network with filecopy and Powershell<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5,6,9],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-exchange","category-lync","category-thoughts"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[{"id":934,"url":"https:\/\/www.vatland.no\/index.php\/simple-powershell-mru-list\/","url_meta":{"origin":85,"position":0},"title":"Simple Powershell MRU list","author":"Atle","date":"December 23, 2019","format":false,"excerpt":"When using using my secret server powershell functions I got tired of constantly searching for secret ID's. I had to do a new search just because I could not remember the ID's. So I added some kind of MRU to my get-secretID function. This code block creates to classes mruitem\u2026","rel":"","context":"In &quot;Powershell&quot;","block_context":{"text":"Powershell","link":"https:\/\/www.vatland.no\/index.php\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":835,"url":"https:\/\/www.vatland.no\/index.php\/powershell-to-get-directaccess-connection-history\/","url_meta":{"origin":85,"position":1},"title":"Powershell to get DirectAccess connection history.","author":"Atle","date":"November 9, 2018","format":false,"excerpt":"This is a simple powershell to get data from the DirectAccess database. It reguired some serious Bing'ing (and google) to get the time field. You will have to configure reporting database in DirectAccess config. I used windows internal database. $server=\"\\\\.\\pipe\\MICROSOFT##WID\\tsql\\query\" $database=\"RaAcctDb\" #$table=\"connectiontable\" $table=\"sessiontable\" #$table=\"endpointsaccessedtable\" #$table=\"serverendpointtable\" $cs=\"server=$server;database=$database;Integrated Security=True;\" $connection=New-Object System.Data.SqlClient.SqlConnection $connection.ConnectionString=$cs\u2026","rel":"","context":"In \"DirectAccess\"","block_context":{"text":"DirectAccess","link":"https:\/\/www.vatland.no\/index.php\/tag\/directaccess\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":35,"url":"https:\/\/www.vatland.no\/index.php\/lync-server-2013-all-channel-servers-are-down\/","url_meta":{"origin":85,"position":2},"title":"Lync server 2013 All Channel servers are down","author":"Atle","date":"September 17, 2013","format":false,"excerpt":"After installing Lync server 2013 persistant chat the service would not stay running. Event Viewer entries complained about incorrect DB Version. The reason for this is that I had installed a CU on the Lync server before I installed Persistent chat service. Reran CU update and the service would start\u2026","rel":"","context":"In &quot;Lync&quot;","block_context":{"text":"Lync","link":"https:\/\/www.vatland.no\/index.php\/category\/lync\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":361,"url":"https:\/\/www.vatland.no\/index.php\/lync-2013-management-shell-will-not-start\/","url_meta":{"origin":85,"position":3},"title":"Lync 2013 Management Shell will not start.","author":"Atle","date":"October 28, 2014","format":false,"excerpt":"If you are running Windows 2012R2 and install Lync server 2013 you might have problems starting Lync Management Shell. The Powershell Windows pops-up but no content appears. To get pass this I try to run PowerShell as Administrator and then run \"import-module Lync\"","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"Lyncserver","src":"https:\/\/i0.wp.com\/www.vatland.no\/wp-content\/uploads\/2014\/08\/Lyncserver-300x94.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":95,"url":"https:\/\/www.vatland.no\/index.php\/move-lync-database-to-new-sql-server\/","url_meta":{"origin":85,"position":4},"title":"Move Lync database to new sql server.","author":"Atle","date":"August 3, 2011","format":false,"excerpt":"This is how I've done it. First in lab then in production. This is moving\u00a0enterprise edition databases. For this to work you need one extra temporary sql server and one Lync server in a temporary Lync pool ,along with the new SQL production server. 1. Export Lync configuration just in\u2026","rel":"","context":"In &quot;Lync&quot;","block_context":{"text":"Lync","link":"https:\/\/www.vatland.no\/index.php\/category\/lync\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":367,"url":"https:\/\/www.vatland.no\/index.php\/exchange-server-quarantined-a-mailbox\/","url_meta":{"origin":85,"position":5},"title":"Exchange server quarantined a mailbox.","author":"Atle","date":"November 11, 2014","format":false,"excerpt":"One user tried to run an attachment in a newly received email \u00a0. After this his mailbox became inaccessible. When he tried to access it\u00a0using OWA the familiar message appeared\u00a0: Something went wrong. My first thought was that the database was dismounted, but other mailboxes on the same database still\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"exchange","src":"https:\/\/i0.wp.com\/www.vatland.no\/wp-content\/uploads\/2014\/09\/exchange.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vatland.no\/index.php\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}