How to copy onedrive files to another onedrive files

To off-board office 365 users so that run termination process, we  consider which data should store and how to do it.

Today let me share how to copy someone who will terminate their onedrive for business folder’s data to specific user’s office 365 onedrive folders. [I did referenced it by this link from technet.]

If we copy and paste and run code in the powershell ise, we will get error like below.

Then you can also get error like below.

So you can’t run it smoothly as you want, but if you want to run it smoothly, please go to powershell gallery, then you can change cmdlets to “Reslove-PnPFolder” instead of “Ensure-PnPFolder”, then it works well.

And you need to know before run script, there are some limitations when the file size exceeds 250MB, it should move files as manually.

I will upload full code to specific location when I find adequate repository.

Electronic Discovery(EDiscovery)

Sometimes defined as how records managers and litigators discover content stored in electonic format. It means the process by which searches are conducted across online sources so that information meeting the criteria for a legal discovery order can be found and made available for review

Both Exchange Online and SharePoint Online suppor in-place holds. It works by retaining content where is stored when a discovery search is performed. In-place hold is able to include all kinds of content stored in a mailbox or site. If items that come under the scope of an in-place hold are edited or deleted after hold is created, the application ensures the information is retained. For example, if a mailbox owner attempts to delete an item that is on hold, Exchange Online creates a copy of the items in a folder in the Recoverable items structure. The copied items are invisible to users and client but can still be discovered and retrieved by searches. [All coments are gotten by office 365 for IT pros book]

recv1

As I know the Recoverable items structure quota is 100G, if that structure is exceeeded to that quota, there are some odd symptoms such as deleted items folder cannot clean-up even if users are trying to deleted items from user’s folder, so as to use EDiscovery feature for storing and searching data , I think users need to use online archive instead of deleteing items on their folders.

 

Anyone who are reading this EDiscovery feature, you need to know that Recoverable items sturcture, if you see Office 365 for IT Pros mentioned when that structure’s quota is exceeded , it needs to contact to increase or not of that structure, but when I checked to ms engineer, that feature is not use.

 

 

Get started with Office 365 SharePoint Online dev – create environment part 1

I finally find some pages related to how to make environment for office 365 sharepoint online dev, if you want to know that, you should go this link.

I’ve already created office 365 my own tenant and with my own configuration such as domain which I own, service and other service values to activate for office 365. so this post just concentrate on how to make environment for office 365 sharepoint online dev.

First. Go to SharePoint admin center , then select settings

SPAdminCenter.pngThen go to “Custom Script” section, please change value to “Allow users to run custom script on personal sites”

CustomScript.pngSecond, You go to SharePoint admin center, then open apps

apps.png Click to “App Catalog” appcatalog.png Select  “There is no app catalog site created for your tenant”. then select “Create a new app catalog sitecreatenewappcat.png

You have to valid values to create app catalog site , if input properly , click “OK”createnew.png if you go to SharePoint admin center, you can see the site which you just created , it looks provisioning to that site. sitelist.png

You can use it to upload any custom apps that your organization has developed.Uploading custom apps isn’t much more complicated that uploading a document to a library and setting some properties. You can use the App Catalog site to do things like install custom or third-party apps on sites for users (also called app deployment), if you want to know more how to add custom apps and install apps, you need to go to this link.

Frankly I’m happy to make this post, it is clearly help to approach sharepoint online development.

Client Object model and Rest API-JavaScript Apps (1)

To create apps using Visual Studio 2015 Community, you need to make sure create sharepoint teamsite as developer site. We should make apps on developer site, then it need to deploy to app store. If you use not developer site but teamsite, on debugging , you can meet error as “Error occurred in deployment step “Install SharePoint-Add in’ : Sideloading of apps is not enabled on this site.”

Today I’ll show how to create javascript apps on online sharepoint

Create new project on visual studio 2015 communtiy

  1. Open Visual Studio 2015 community as administrator
  2. Make new project , select to Office Add-ins as “SharePoint Add-In” as name of JavaScriptDemo2createnewproject
  3. You need to input “What SharePoint site do you want to use for debugging your add-in?” to sharepoint developer site, and also select “SharePoint-hosted”newSharePointAddIn
  4. You need to select “SharePoint Online” on the Specify the target SharePoint versionspecifiyTheTargetSP
  5. It creates “JavaScriptDemo2” project as automatically

See around project which you created.

You can see Default.aspx page , it have SharePoint Script as “sp.js” , jquery and app.js.

Let me explain those components.

SP.ClientContext object (sp.js) : Represents the context for objects and operations.ClientContext constructor  initializes a new instance of the ClientContext object for the specified SharePoint site.

app.js : you can add javascript code and jquery code also

Let’s do it as easy example.

Create button on Default.aspx as Html Tag inputButton

Move to App.js then remove all scripts except ‘use strict’ on top of this script.appJsSc

After you save all changes then you need to “Execute” Button on Visual Studio, you can see deployed apps on this sharepoint like below. defaultPage

If you click “Load” Button, you can show below site as changed to message as “JavaScriptDemo1”AfterClickButton.png

This post which I recently uploaded to this blog to study online sharepoint as client object model. Since now I’ll create and concentrate on online sharepoint development

 

SharePoint Online Add-In 500 Internal Server Error

As you know when we deploy app online sharepoint , we can meet 500 Internal Server error in the on-premise sharepoint error, but how about this error on the cloud based online sharepoint? On-Premise sharepoint we can check IIS Log or SharePoint Central Administration, unfortunately there are no SharePoint Central Administration or IIS Log.

Error

HTTP 500 Internal Server Error when deploy sharepoint add-in to online sharepoint.

Which code made error

WebPartZone1.png If I added that part then , it made interanl server error, as if this web part or WebPartPages:XsltListViewPart doesn’t work well in this app.

Reference

This link is located in GitHub’s PnP explains , Developers should not simply include WebPart markup in the ASPX page itself. Doing so can cause errors when the add-in is updated.

webpartzone3.png

Summary

Obviously there are some changes for sharepoint development to add-ins. It needs to check GitHub’s PnP at first, then check the book or develop my own self.

 

 

Error of SharePoint-hosted app for deployed

I have error for deploying specific simple app to sharepoint-hosted on onffice 365 environment. But I’m not sure why it happens whenever I deploy sharepoint-app like An unexpected error has occurred.

Errors:

AppError.png

Resolution:

 

Sideloading of apps is not enabled on this site

If you are making a site for app developing test….In this case normally we must create using development site. But sometimes we don’t know, so that deploy specific app project, it shows Error “Error occurred in deployment step ‘Install SharePoint Add-in: sideloading apps is not enabled on this site.

Solution : It needs to activate sideloading Features on the site.But I think it is able to activate on site collection features or site features, but no matter how  I check that features on site settings, there are no features, so you must use powershell, please check this link : I am also using this powershell then I activated it

EnabledSideLoading.png

Key is below like that

$sideLoadingGuid = new-object System.Guid “AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D”
$site.Features.Add($sideLoadingGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);

$cc.ExecuteQuery();

Then if I deploy my app to sharepoint, it is successfully deployed , but then it has problem which I’ve created.

Creating SharePoint Online SiteCollection

To create sharepoint online site collection , you need to check and use “New-SPOSite” cmdlet. It describes “creates a new site collection for the current company”, it needs to load “Import-Module Microsoft.Online.SharePoint.PowerShell ” module and authentication and connect-spo service before using create sharepoint cmdlet after remote connection via powershell.

Parameters

  • Url : [Required] Specifies the full URL of the new site collection, must be in a valid managed company’s site, valid managed paths are https://contoso.sharepoint.com and https://contoso.sharepoint.com/teams  for company contoso
  • Owner : [Required] : user name of the site colletion’s owner, must be user , security gorup , or email-enabled security group
  • StorageQuota : [Required] : the storage quota for this creating site collection in megabytes. It must be set lower than 1024 megabytes.
  • CompatibilityLevel, LocaleId, NoWait, ResourceQuota, Template, TimeZoneId, Title , these are optional parameters
  • Owner must be user related active directory
  • One Site Collection Quota is 1 terra bytes.

Site Creation

CmdLet

New-SPOSite -Url https://cloudwide1603.sharepoint.com/sites/devSite -Owner owner’s email address -Template STS#0 -Title “Dev site” -StorageQuota 5000 -CompatibilityLevel 15ShowSiteCollectioList.pngthen it can show site collection which I created using powershell.

Summary

If is easy to create site collecton using powershell like GUI creation page. And I think we need to list up Template list to create various sites, teamsite, blog, search center…

 

Managing your own domain to Office 365[1]

If we create my own tenant on office 365, it creates domain tenantName.onmicrosoft.com. but this domain looks difficult to memorize it, so if you have your own domain , you can change domain easy to memorize it.

Adding a New Domain

Adding a new domain in Windows Azure Active Directory  , there are three steps

  1. Add and validate the actual domain;
  2. Configure and validate DNS records (domain purpose);
  3. Configure or add users

Add and validate the actual domain

To add a new domain we can use the New-MsolDomain cmdlet with -Name option, I did only use -Name option , but needs to -Authentication options is used to pass the type of domain, which is either Managed or Federated. if we are using ADFS with DirSync as Azure Directory Service, we are using Federated, [I will configure ‘Federated’ domain after a few days during installation of ADFS] but in this example use Managed.

New-MsolDomain -Authentication Managed -Name YSAH.ORGManagedDomain.pngWhen the domain is entered into Office 365 , it needs to be validated with the Get-MsolDomainVerificationDns cmdlet. If you use Get-Help Get-MsolDomainVerification -Full, it describes “Retrieves a list of records to configure a domain“, if we are configure on the office 365 admin portal dns page, we must set txt record or mx record to verify a new domain is mine or not. Also if you want to use Skype , Online SharePoint, etc.. it needs to set srv records to azure active directory.  I prefer to use a TXT record (DnsTxtRecord) than MX record (DnsMxRecord) to verify domain.   Get-MsolDomainVerificationDns -DomainName YSAH.ORG -Mode DnsTxtRecord , it returns txt record.GetTxtRecord.png After adding this record to public DNS which I bought that domain, must be verified using the Confirm-MsolDomain cmdlet. Confirm-MsolDomain -DomainName YSAH.ORG  , it returns AvailabilityDetails

confirmmsoldomain.png  The domain is now added to Office 365 with my test tenant ,

Configure and validate DNS records (domain purpose)

The next step in the Mircrosoft Online Portal is to configure uses and the domain purposes. i.e. used with Exchange Online and Skype Online. Based on your selections the DNS records are shows which you have to configure. If I check the status is Setup in progress (domain verified) is shown . domainverifed.pngUnfortunately it is not possible using Powershell to configure the domain purpsose, so you have to use the Microsoft Online Portal or leave it this way.

Formally you don’t have a finalized domain setup and as such you most likely will be in an unsupported configuration. The domain purpose is configured on the domain, when you use the command Get-MsolDomain | select Name, capabilities in Powershell on the domain purpose is actually shown when the domain is configured in the Microsoft Online Portal. getmsoldomain.png The differences are clearly visible. The ysah.org domain is created using PowerShell, On the other hand , when you leave it this way the entire configure will work as expected, as long as you configure your public DNS with the correct entries. Frankly this configure and validate DNS record items looks difficult, so as to use Exchange Online , Skype Online , it needs to set record to public DNS entries. but I don’t know what is public DNS entries, my domain ,

New domains in Exchange Online

When you’ve added a new domain in Azure Active Directory , it is automatically added to Exchange Online as an ‘authoritative domain’.

 

Summary

You can use PowerShell without configuring Office 365 Admin Portal Page. Creating new domain and setting values are easy than we expected. But domain purpose is not configurable via PowerShell, I’ll check more and more “domain purpose”

 

Permanently Delete a SharePoint Site

To permanently delete a sharepoint site, you need to use powershell. In my case, I had two site colections which I’ve created, but even if I removed them from sharepoint admin center, it moves to reclye bin, but until expiration of this service, I just have 4 days, so ast to remove permanenlty sharepoint site, I have to use sharepoint site with no wait.                If you go to sharepoint admin center, then remove a site, it moves to recyle bin with 30days. OnlineManagementShell.png

It needs to install SharePoint Online Management Shell, then needs to connect online sharepoint using powershell, later I’ll remove shrepoint site with no-wait option.

# Set password to encrypted value as specific txt file
Read-Host -Prompt “Enter password to be encrypted in mypassword.txt” -AsSecureString | ConvertFrom-SecureString | out-file “D:\O365securestring_test.txt”
# Get value from encrypted value from txt file
$password = cat “D:\O365securestring_test.txt” | ConvertTo-SecureString
$upn = “my upn address”
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist $upn,$password
# Import SharePoint Module
Import-Module “C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell”
#Connect to SharePoint Online
Connect-SPOService -URL “https://cloudwide1602-admin.sharepoint.com” -Credential $O365Cred

SharePoint_Online_Management_Shell_Prmpt then it pops up Microsoft SharePoint Online Management Shell page, then I added my upn and password, the reason why that pop-up as authentication is , I’m not using “SharePoint Online management shell”, so it pop-up

It needs to check with current site collection using “Get-SPOSite“, and if you use “Get-SPODeletedSite” cmdlet, it returns  “Returns all deleted site collections from the Reclye Bin“, I have to remove this site collection from recyle-bin, how can I do it?SPODeleteSite.png  In this case , I can use Remove-SPODeletedSite which can do function as “Remove a SharePoint Online deleted site collection from the Recycle Bin“, ex) Remove-SPODeletedSite -Identity https://cloudwide1602.sharepoint.com/sites/Teamsite , If I do exectue that command, then I try  Get-SPODeletedSite to verify the site which I want to delete is existed or not, there is no site from Recyle bin.

Or, If you want to permanently delete a sharepoint site collection, you need to use          Remove-SPOSite -Identity “Site Collection to delete” -NoWait        Confirm_RemoveSPOSite.png                                    Start-Sleep -s 20      [Pause script for 20 seconds before proceeding]                                                                                                                                         Remove-SPODeletedSite  -Identity “Site Collection to delete” Confirm_spodeletesite.png

In the Remove-SPOSite cmdlet have a NoWiat Parameter, it directs “specifies to continue executing script immediately”

텐서 플로우 블로그 (Tensor ≈ Blog)

머신러닝(Machine Learning), 딥러닝(Deep Learning) 그리고 텐서(Tensor) 또 파이썬(Python)

Jaap Wesselius

Microsoft UC Specialist

Office365 Cloud for My site

Office365 & SharePoint & PowerShell