本文介绍了如何使用powershell使用没有任何时间值的日期获取SharePoint创建的日期字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们正在生成包含所有网站详细信息的报告,例如标题,网址,用户名,创建的数据和修改日期。

We are generating report with all sites details like title, url, user name, created data and modified date.

我们使用以下脚本生成报告。

We used below script for generating report.

#Using this script getting Farm level sites information
  Get-SPWebApplication | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL |
  where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } | 
  foreach { $Title=$_.title;$TTNweburl = $_.Url; $_ ;$SiteCreatedDate=$_.Created; $SiteModifiedDate=$_.LastItemModifiedDate}| 
  Select -ExpandProperty AssociatedOwnerGroup | 
  Select -ExpandProperty Users |
  Select {$Title},{$TTNweburl}, UserLogin, DisplayName, TEXT({$SiteCreatedDate},"d/m/yyyy"), TEXT({$SiteModifiedDate},"d/m/yyyy")|
  Export-Csv -Path  C:\SITESINFO.csv -Force


 

使用此脚本创建的日期和修改日期我们得到时间值,我们只需要没有任何时间值的日期。

 

with this script created date and modified date we are getting with time value, we need only date without any time value.

请告诉我们我们需要的地方更改此脚本。

Kindly let us know where we have to change this script.

感谢你,Nagendra。

Thanking You, Nagendra.

推荐答案

 Get-SPWebApplication | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL |
  where {




这篇关于如何使用powershell使用没有任何时间值的日期获取SharePoint创建的日期字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 02:52